Reference text
http://www.globalguideline.com
http://www.javascriptfreecode.com/
http://javaboutique.internet.com/
http://www.geocities.com/SiliconValley/Station/432
… continue reading this entry.
http://www.globalguideline.com
http://www.javascriptfreecode.com/
http://javaboutique.internet.com/
http://www.geocities.com/SiliconValley/Station/432
… continue reading this entry.
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Untitled Document</title>
<style type=”text/css”>
#usernamediv {
width:400px;
border:1px solid #000;
display:none;
color:#FF0000;
font-family:Trebuchet MS;
font-size:12px;
}
</style>
<script type=”text/javascript”>
function check(what,where){ //function used to validate contact form
if (document.forms[0].elements[what].value == “”) {
document.getElementById(where).style.display=’block’;
document.forms[0].elements[what].focus();
}
else if(document.forms[0].elements[what].value != “”) {
document.getElementById(where).style.display=’none’;
}
}
</script>
</head>
<body>
<div id=”usernamediv”>Please enter your username.</div>
<form>
<input type=”button” onclick=”check(1,’usernamediv’)” value=”focus()” />
<input type=”text” name=”blah” id=”blah” onblur=”check(1,’usernamediv’)”/>
</form>
</body>
</html>
<SCRIPT LANGUAGE=”JavaScript”>
<!– Begin
var params=new Array(4);
var script=document.js.scrpt.value;
document.js.scrpt.value=”Create your users, their passwords, and their destination pages using the form above.\n\nThen, click ‘Show Coding’ to see the login HTML and JavaScript that you need to put on your page to password-protect your site with that info.\n\nQuestions about this script or how to put it on your site should be directed to it’s author via email: dion@mailhub.omen.com.au\n\n*Honestly, we don’t even totally understand this JavaScript!*”;
var alpha=”ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHI”;
showmem(document.members);
function showmem(form) {
document.members.num.value=document.members.memlist.length;
var which=form.memlist.selectedIndex;
splt(form.memlist[which].value);
form.entry.value=which+1;
for (i=2;i<5;i++) {
form.elements[i].value=params[i-2]; };
}
function splt(choice) {
p=0;
for (i=0;i<3;i++) {
a=choice.indexOf(”|”,p);
params[i]=choice.substring(a,p);
p=a+1;
}
}
function addnew(form) {
newmem=getfields(form);
var who=prompt(”New User’s Name:”,”");
form.memlist[form.memlist.length] = new Option(who, newmem, false, true);
if (navigator.appName==”Netscape”) {
document.js.scrpt.value=script;
history.go(0);
}
else {
showmem(document.members);
}
}
function getfields(form) {
newmem=”";
for (i=2;i<5;i++) {
newmem+=form.elements[i].value+”|”; };
for (i=3;i<5;i++) {
a=form.elements[i];
for (k=0;k<8;k++) {
}
}
return(newmem);
}
function delthis(form) {
if (confirm(”Delete “+form.memname.value+”?”)) {
form.memlist.options[form.entry.value-1]=null;
form.message.value=form.memname.value+” Deleted”;
form.memlist.selectedIndex=0;
if (navigator.appName==”Netscape”) {
document.js.scrpt.value=script;
history.go(0);
}
else {
showmem(document.members);
}
}
}
function update(form) {
msg=”no”;
a=form.elements[i];
for (k=0;k<8;k++) {
b=a.value.substring(k,k+1);
c=b.toUpperCase();
form.memlist[form.entry.value-1].value=getfields(form);
form.message.value=form.memname.value+”’s record was updated”;
}
}
function create(form) {
var html=”<center><form name=login>\n”;
html+=”<table border=1 cellpadding=3>\n\n”;
html+=”<!– Original: Dion –>\n”;
html+=”<!– Web Site: http://members.xoom.com/yoboseyo –>\n”;
html+=”<!– This script and many more are available free online at –>\n”;
html+=”<!– The JavaScript Source!! http://javascript.internet.com –>\n\n”;
html+=’<tr><td colspan=2 align=center><font size=”+2″>’;
html+=’<b>Members-Only Area!</b></font></td></tr>\n’;
html+=”<tr><td>Username:</td><td><select name=memlist>\n<option value=’x'>”;
for (j=0;j<form.memlist.length;j++) {
splt(form.memlist.options[j].value);
h1=makehash(params[1],3);
h2=makehash(params[1],10)+” “;
var page=”";
for (var i=0;i<8;i++) {
letter=params[2].substring(i,i+1);
ul=letter.toUpperCase();
a=alpha.indexOf(ul,0);
a+=(h2.substring(i,i+1)*1);
page+=alpha.substring(a,a+1);
}
html+=”\n<option value=’”+params[0]+”|”+h1+”|”+page+”‘>”+params[0];
};
html+=”\n</select></td></tr>\n”;
html+=”<tr><td>Password:</td><td><input type=password size=10 maxlength=8 name=pass></td></tr>\n”;
html+=’<tr><td colspan=2 align=center><input type=button value=”Login” onclick=”check(this.form)”></td>\n’;
html+=”</tr>\n</table>\n</form>\n”;
document.js.scrpt.value=html+script+”</center>”;
}
function makehash(pw,mult) {
pass=pw.toUpperCase();
hash=0;
for (i=0;i<8;i++) {
letter=pass.substring(i,i+1);
c=alpha.indexOf(letter,0)+1;
hash=hash*mult+c;
}
return(hash);
}
// End –>
</script>
<table border=1 width=”400″>
<tr><form name=members><td rowspan=4>
<select name=memlist size=10 onChange=”showmem(this.form)”>
<option selected value=”John Smith|password|mainpage|”>John Smith
<option value=”Peter Jones|theirpwd|endpages|”>Peter Jones
<option value=”Sue Brown|asdfvcxz|nowheres|”>Sue Brown
<option value=”Sally West|zaqxswde|logintop|”>Sally West
</select></td>
<td align=right>User:</td><td><input type=hidden value=”0″ name=entry>
<input type=text name=memname size=8 value=”"></td></tr>
<tr><td align=right>Password:</td><td><input type=text name=password size=8 maxlength=8><font size=”-1″><– Must be exactly 8 characters</font></td></tr>
<tr><td align=right>Page Name:</td><td><input type=text name=pagename size=8 maxlength=8><b>.html</b><font size=”-1″><– Must be exactly 8 characters</font></td></tr>
<tr><td colspan=2 align=center>
<input type=button value=”New User” onclick=”addnew(this.form);”>
<input type=button value=”Delete User” onclick=”delthis(this.form);”>
<input type=button value=”Update/Show Coding” onclick=”update(this.form); create(this.form);”></td></tr>
<tr><td colspan=3 align=center>
<input type=text size=60 name=message value=”Note: Password/Page Name must be exactly 8 letters! (a-z)”>
<input type=hidden name=num value=1></td>
</form></tr>
</table>
<SCRIPT LANGUAGE=”JavaScript”>
<!– Begin
function makeArray(q){
for(i=1 ; i < q ; i++){this[i]=0}}
w=1;
howmanysites=4; // How many sites are listed below?
Sites = new makeArray(howmanysites);
<!– STEP TWO: Use the pattern: url~Site Title|Description for links –>
Sites[1] = “http://www.cgi-resources.com~CGI Resource Index|CGI scripts!”;
Sites[2] = “http://www.geocities.com~Geocities|Free webspace!”;
Sites[3] = “http://www.yahoo.com~Yahoo!|Great Directory!”;
Sites[4] = “http://www.webknowhow.net~WebKnowHow.Net|Webmaster resources!”;
function showSites() {
if (w > howmanysites) { w=1; };
var string=Sites[w] + “”;
var split1=string.indexOf(”~”);
var split2=string.indexOf(”|”);
var url=string.substring(0,split1);
var name=string.substring(split1 + 1,split2);
var word=string.substring(split2 + 1,string.length);
document.form.url.value=url;
document.form.name.value=name;
document.form.word.value=word;
w+=1;
window.setTimeout(’showSites()’,3000);
// You can change the speed! 3000 = 3 sec delay. 5000 = 5 sec delay, etc.
}
function visitSite() {
window.location=document.form.url.value;
}
// End –>
</SCRIPT>
<table width=420>
<tr>
<td align=center>
<center>
<form name=form>
<table><tr><td align=center>
<input type=button name=name value=”Visit” onClick=”visitSite()” size=25>
<input type=hidden name=url value=”">
<input type=text name=word value=”" size=40>
</td></tr></table>
</form>
</center>
<script>
showSites();
</script>
</td>
</tr>
</table>
<script language=”JavaScript”>
<!–
function go_to_station(){
if (document.stationform.stationselect.options[0].selected){
window.location.href = “http://www.yahoo.com”;}
else if (document.stationform.stationselect.options[1].selected)
{ window.location.href = “http://www.excite.com”;}
else if (document.stationform.stationselect.options[2].selected)
{ window.location.href = “http://www.altavista.com”;}
else if (document.stationform.stationselect.options[3].selected)
{ window.location.href = “http://www.webcrawler.com”;}
else if (document.stationform.stationselect.options[4].selected)
{ window.location.href = “http://www.infoseek.com”;}
return true;
}
function textValue(){
var stationInteger, stationString
stationInteger=document.stationform.stationselect.selectedIndex
stationString=document.stationform.stationselect.options[stationInteger].text
document.stationform.stationtext.value = “Go to ” + stationString +”!” }
//–>
</script>
<h1>Search Engines</h1>
Select a search engine from the list to go to it’s site
<form name=”stationform”>
<select name=”stationselect” onChange=”textValue()” multiple size=”5″>
<option>Yahoo
<option>Excite
<option>Alta Vista
<option>WebCrawler
<option>Infoseek
</select>
<br><p>
<input type=”button” name=”stationbutton” value=”Go!” onClick=”go_to_station()”>
<p>
<input type=”text” name=”stationtext” value=”" size=”35″ maxlength=”35″>
<p>
</form>
Put your cursor over the link and you will automatically be sent to that URL.<br>
<a href=”" onmouseover=”parent.location=’http://www.netscape.com/’”>Netscape cursor link</A>
<TABLE BORDER=1 BGCOLOR=black>
<TR><TD>
<FORM NAME="clock_form">
<INPUT TYPE=TEXT NAME="clock" SIZE=35>
</FORM>
<SCRIPT LANGUAGE="JavaScript">
<!-- Hide from non JavaScript browsers
function clockTick()
{
currentTime = new Date();
document.clock_form.clock.value = " "+currentTime;
document.clock_form.clock.blur();
setTimeout("clockTick()", 1000);
}
clockTick();
// End of clock -->
</SCRIPT>
</TD></TR>
</TABLE>
<!–this script got from www.javascriptfreecode.com-Coded by: Krishna Eydatoula –>
<!– Start Of Drop Down Links Script –>
<!– Consolidate a bunch of links to a simple drop down menu –>
<!– Instructions: Just put this in your page where you want to display links. –>
<!– Script supplied with CoffeeCup HTML Editor –>
<!– www.webloger.5u.com –>
<script language=”JavaScript”>
function CC_go(form) {var myindex=form.dest.selectedIndex
window.open(form.dest.options[myindex].value, target=”_parent”, “toolbar=yes,scrollbars=yes,location=yes”); }
</script>
<form name=”CC_LinkForm”>
<select name=”dest” SIZE=1>
<option selected value=”">Places to go
<option value=”http://www.webloger.5u.com/”>Webloger Website
<option value=”http://home.cnet.com/”>CNET
<option value=”http://www.tucows.com”>Tucows
</select>
<P>
<input type=”button” value=”Link Me!” onClick=”CC_go(this.form)”>
</form>
<!– End Of Drop Down Links Script –>
<!–this script got from www.javascriptfreecode.com-Coded by: Krishna Eydatoula –>
<!– DESCRIPTION: This will make the browser jump to the
page of your choice once the user puts the mouse over the link.
INSTRUCTIONS: Place this code in your webpage. Use the
model given to modify your own links. Can be used with an Image
or simply use text.
FUNCTIONALITY: Works in both Netscape & IE.
//Modified by CoffeeCup Software
//This code is Copyright (c) 1997 CoffeeCup Software
//all rights reserved. License is granted to a single user to
//reuse this code on a personal or business Web Site.
–>
<CENTER>
<a href=”http://www.webloger.5u.com/” target=main onmouseover=”window.open
(’http://www.javascriptfreecode.com/’);” style=”text-decoration: none”><FONT SIZE=7 FACE=ARIAL COLOR=#804000>www.javascriptfreecode.com</FONT></a></CENTER><P>
<!– this script got from www.javascriptfreecode.com-Coded by: Krishna Eydatoula –>
<p><!–webbot bot=”HTMLMarkup” startspan –><form name=”redirect”>
<center>
<font face=”Arial”><b>You will be redirected to the script in<br><br>
<form>
<input type=”text” size=”3″ name=”redirect2″>
</form>
seconds</b></font>
</center>
<script>
<!–
var targetURL=”http://www.javakhafan.7p.com”
var countdownfrom=5
var currentsecond=document.redirect.redirect2.value=countdownfrom+1
function countredirect(){
if (currentsecond!=1){
currentsecond-=1
document.redirect.redirect2.value=currentsecond
}
else{
window.location=targetURL
return
}
setTimeout(”countredirect()”,1000)
}
countredirect()
//–>
</script>
<!–webbot bot=”HTMLMarkup” endspan –></p>
</body>
</html></body>
</html>
<font face=”Tahoma”><a target=”_blank” href=”http://www.javascriptfreecode.com/”><span style=”font-size: 8pt; text-decoration: none”>JavaScript Free Code</span></a></font>