|
|
|||||||||
Copy this code into the top of your html page, just below the </head> document.
<script>
if (document.images) {
image1on = new Image();
image1on.src = "aboutb.gif";
image2on = new Image();
image2on.src = "excelb.gif";
image1off = new Image();
image1off.src = "about.gif";
image2off = new Image();
image2off.src = "excel.gif";
}
function turnOn(imageName) {
if (document.images) {
document[imageName].src = eval(imageName + "on.src");
}
}
function turnOff(imageName) {
if (document.images) {
document[imageName].src = eval(imageName + "off.src");
}
}
</script>
Copy this code into the particular area that you would like to see the image change.
<a href="aboutme1.htm" onmouseover="turnOn('image1'); window.status='About John';return true;" onmouseout="turnOff('image1');window.status='';return true;"><img src="about.gif" alt="Who is this guy John?" border="0" width="89" height="18" name="image1"></a>
<a href="excel.htm" onmouseover="turnOn('image2'); window.status='Develop MS Excel';return true;" onmouseout="turnOff('image2');window.status='';return true;"><img src="excel.gif" alt="Develop MS Excel" border="0" width="160" height="18" name="image2"></a>
Copy this code and place it anywhere you want it to appear:
<SCRIPT LANGUAGE="JavaScript">
var LastUpdated = document.lastModified;
document.writeln ("This page was last updated " + LastUpdated);
</SCRIPT>
Copy this code anywhere you would like the field to appear:
<form name="forma">
<input name="passwordinput" type="text">
<input type="button" value="Verify Password" onClick="verify()">
</form>
<script LANGUAGE="Javascript" SRC="script1.js">
Copy this to a new notepad document and save it as script.js
<!-- function verify() { password1 = 'dude' correct = 'yourpage.htm' incorrect = 'invalid.htm' if (form.password.value == password1) { location.href=correct } else { location.href=incorrect } } // -->
Copy to top of document, under the </head> tag:
<SCRIPT LANGUAGE="JavaScript">
<!--
function makearray(n) {
this.length = n;
for(var i = 1; i <= n; i++)
this[i] = 0;
return this;
}
hexa = new makearray(16);
for(var i = 0; i < 10; i++) hexa[i] = i;
hexa[10]="a"; hexa[11]="b"; hexa[12]="c";
hexa[13]="d"; hexa[14]="e"; hexa[15]="f";
function hex(i) {
if (i < 0)
return "00";
else if (i > 255)
return "ff";
else
return "" + hexa[Math.floor(i/16)]
+ hexa[i%16];
}
function setbgColor(r, g, b) {
var hr = hex(r); var hg = hex(g); var hb = hex(b);
document.bgColor = "#"+hr+hg+hb;
}
function fade(sr, sg, sb, er, eg, eb, step) {
for(var i = 0; i <= step; i++) {
setbgColor(
Math.floor(sr * ((step-i)/step)
+ er * (i/step)),
Math.floor(sg * ((step-i)/step)
+ eg * (i/step)),
Math.floor(sb * ((step-i)/step)
+ eb * (i/step)));
}
}
fade(0,0,0,255,255,255,150);
// -->
</SCRIPT>
Copy this code into the <head> portion of your frames page, and only define the frames links in the body of the page.
<script>
bVer = parseInt( navigator.appVersion );
if( navigator.appName == "Netscape" && bVer >= 3 )
document.write (' <FRAMESET ROWS="60,*" BORDER=0 FRAMEBORDER=NO
FRAMESPACING=0>')
else if( navigator.appName == "Microsoft Internet Explorer" &&
bVer >= 4)
document.write (' <FRAMESET ROWS="55,*" BORDER=0 FRAMEBORDER=NO
FRAMESPACING=0>')
else
document.write ('<FRAMESET ROWS="60,*" BORDER=0 FRAMEBORDER=NO
FRAMESPACING=0>')
</script>
Copy this code underneath the </head> tag.
<SCRIPT TYPE="text/javascript">
<!--
if (top == self)
{
location.href="correctpagenamehere.htm";
}
// -->
</SCRIPT>
Copy this code into any old page, or page that you want redirection from:
<meta http-equiv="refresh" content="5; URL=yourwebpagename.htm">
Copy this and paste it underneath the </head> tag:
<SCRIPT LANGUAGE="JavaScript">
alert('Here you type your text and you can place here whatever warning
you want!!!!!!!');
</SCRIPT>
Copy this code into the parent or dependent frame on your web page:
<BASE TARGET="Main">
<script language="JavaScript">
<!--
function buildArray() {
var a = buildArray.arguments;
for (i=0; i<a.length; i++) {
this[i] = a[i];
}
this.length = a.length;
}
var urls1 = new buildArray("",
"yourwebpage1.htm",
"yourwebpage2.htm",
"Yourwebpage3.htm",
"you can keep adding names.htm");
function go(which, num, win) {
n = which.selectedIndex;
if (n != 0) {
var url = eval("urls" + num + "[n]")
if (win) {
openWindow(url);
} else {
parent.Main.location = url;
}
}
}
// -->
</script>
Copy this into the area you want the box to be viewed:
<form name="form1">
<select name="menu1" onChange="go(this, 1, false)">
<option>Name of drop down box to whatever you want
<option>Change this to the name you want to appear for the first
link
<option>second link name
<option>third link name
<option>fourth link name
<option>fifth link name
</select>
</form>
Copy this into the underneath the head tag, and replace or delete the address you want to be referred to.
<SCRIPT language="JavaScript">
<!--
function buildArray() {
var a = buildArray.arguments;
for (i=0; i<a.length; i++) {
this[i] = a[i];
}
this.length = a.length;
}
var urls1 = new buildArray("",
"http://www.cob.ohio-state.edu/~fin/jobs/ib2.htm#Link4",
"http://www.cob.ohio-state.edu/~fin/jobs/ib2.htm#Link4",
"http://www.moneysearch.com",
"http://stocksense.com/valuation.html",
"http://www.wiso.gwdg.de/ifbg/finance.html",
"http://www.yardeni.com/sitemap.html",
"http://www.cob.ohio-state.edu/dept/fin/osudata.htm",
"http://margrabe.com/Links.html",
"http://www.fiu.edu/~daiglerr/deriv.htm",
"http://www.derivatives.com/comix/",
"http://www.chaoskitty.com/t_chaos/lounge.html",
"aboutme1.htm",
"Derivativepricing1.htm",
"johnres.htm",
"equity.htm",
"excel.htm",
"mailto:johnjaz@netcom.ca?subject=Page Visitor",
"index.html");
function go(which, num, win) {
n = which.selectedIndex;
if (n != 0) {
var url = eval("urls" + num + "[n]")
if (win) {
openWindow(url);
} else {
location.href = url;
}
}
}
// -->
</SCRIPT>
Copy this to the area you would like to see the box appear. Be sure to change the names of your links so that they match correctly. The first name is reserved for the title that appears by default.
<FORM name="form1"><SELECT name="menu1" onChange="go(this, 1, false)">
<OPTION>Your title goes here
<OPTION>Careers in Investment Banking
<OPTION>Careers in Corporate Finance
<OPTION>Fundamental Information
<OPTION>Valuation Theories and Explanations
<OPTION>Various Finance Links
<OPTION>Economic indicators by Ed Yardini
<OPTION>OSU Finance Links
<OPTION>Various Derivative Links
<OPTION>Comprehensive Derivative Links
<OPTION>Comics about Derivatives
<OPTION>Loungin @ Vic's
<OPTION>About Me
<OPTION>Reseach Reports
<OPTION>Resume
<OPTION>Equity Valuation Example
<OPTION>Excel Development
<OPTION>Email Me
<OPTION>Back to Main Page
</SELECT></FORM>
Copy this script to the area that you would like to use the button.
<form>
<input type = "button" value="Button Title" OnClick ="location.href='yourpagenamehere.htm'">
</form>
Simply paste this code wherever you want to a button to display an alert:
<form>
<input type = "button" value="Button Title" OnClick ="alert('Here
you type your text and you can place here whatever warning you want!!!!!!!')">
</form>
Copy this code at the end of your document just before the </body> tag.
<div id="waterMark" style="position:absolute"><a href="javascript:void(0)"
ONCLICK="open('yourpagename.htm','yourtitleforpage','toolbar=0,location=0,resizable=1,width=300,height=250')">
<img src="yourimagename.gif" width=39 height=64
alt="Any caption you want!!!" border=0></a>
<script language="JavaScript1.2">
<!--
// Watermark Script
markW = 39; // enter how
many pixels wide your image is
markH = 64; // enter
how many pixels high your image is
markX = 100; // percent right
markY = 100; // percent down
markRefresh = 20; // milliseconds
// set common object reference
if (!document.all) document.all = document;
if (!document.all.waterMark.style) document.all.waterMark.style = document.all.waterMark;
wMark = document.all.waterMark.style;
wMark.width = markW;
wMark.height = markH;
navDOM = window.innerHeight; // Nav DOM flag
function setVals() {
barW = 0; // scrollbar compensation for PC Nav
barH = 0;
if (navDOM) {
if (document.height > innerHeight) barW = 20;
if (document.width > innerWidth) barH = 20;
} else {
innerWidth = document.body.clientWidth;
innerHeight = document.body.clientHeight;
}
posX = ((innerWidth - markW)-barW) * (markX/100);
posY = ((innerHeight - markH)-barH) * (markY/100);
}
function wRefresh() {
wMark.left = posX + (navDOM?pageXOffset:document.body.scrollLeft);
wMark.top = posY + (navDOM?pageYOffset:document.body.scrollTop);
}
function markMe() {
setVals();
window.onresize=setVals;
markID = setInterval ("wRefresh()",markRefresh);
}
window.onload=markMe; // safety for Mac IE4.5
//-->
</script>
Copy this code into the head section of your page:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function addChar(input, character) {
if(input.value == null || input.value == "0")
input.value = character
else
input.value += character
}
function cos(form) {
form.display.value = Math.cos(form.display.value);}
function sin(form) {
form.display.value = Math.sin(form.display.value);}
function tan(form) {
form.display.value = Math.tan(form.display.value);}
function sqrt(form) {
form.display.value = Math.sqrt(form.display.value);}
function ln(form) {
form.display.value = Math.log(form.display.value);}
function exp(form) {
form.display.value = Math.exp(form.display.value);}
function sqrt(form) {
form.display.value = Math.sqrt(form.display.value);}
function deleteChar(input) {
input.value = input.value.substring(0, input.value.length - 1)
}
function changeSign(input) {
if(input.value.substring(0, 1) == "-")
input.value = input.value.substring(1, input.value.length)
else
input.value = "-" + input.value
}
function compute(form) {
form.display.value = eval(form.display.value)}
function square(form) {
form.display.value = eval(form.display.value) *
eval(form.display.value)}
function checkNum(str) {
for (var i = 0; i < str.length; i++) {
var ch = str.substring(i, i+1)
if (ch < "0" || ch > "9") {
if (ch != "/" && ch != "*" && ch != "+" &&
ch !=
"-" && ch != "."
&& ch != "(" && ch!= ")") {
alert("invalid entry!")
return false
}
}
}
return true
}
// End -->
</SCRIPT>
Copy this calculator code into the body of the document:
<SCRIPT LANGUAGE="JavaScript"><!--setStartState()// --></SCRIPT>
<form>
<table BORDER="1" COLS=1 WIDTH="30%" >
<tr>
<td>
<input name="display" value="0" size=30>
</td>
</tr>
</table>
<table BORDER="1" COLS=5 WIDTH="30%" >
<tr>
<td>
<input type="button" value=" exp " onClick="if (checkNum(this.form.display.value))
{ exp(this.form) }">
</td>
<td>
<input type="button" value=" 7 " onClick="addChar(this.form.display,
'7')">
</td>
<td>
<input type="button" value=" 8 " onClick="addChar(this.form.display,
'8')">
</td>
<td>
<input type="button" value=" 9 " onClick="addChar(this.form.display,
'9')">
</td>
<td>
<input type="button" value=" / " onClick="addChar(this.form.display,
'/')">
</td>
</tr>
<tr>
<td>
<input type="button" value=" ln " onClick="if
(checkNum(this.form.display.value)) { ln(this.form) }">
</td>
<td>
<input type="button" value=" 4 " onClick="addChar(this.form.display,
'4')">
</td>
<td>
<input type="button" value=" 5 " onClick="addChar(this.form.display,
'5')">
</td>
<td>
<input type="button" value=" 6 " onClick="addChar(this.form.display,
'6')">
</td>
<td>
<input type="button" value=" * " onClick="addChar(this.form.display,
'*')">
</td>
</tr>
<tr>
<td>
<input type="button" value=" sqrt " onClick="if (checkNum(this.form.display.value))
{cos(this.form) }">
</td>
<td>
<input type="button" value=" 1 " onClick="addChar(this.form.display,
'1')">
</td>
<td>
<input type="button" value=" 2 " onClick="addChar(this.form.display,
'2')">
</td>
<td>
<input type="button" value=" 3 " onClick="addChar(this.form.display,
'3')">
</td>
<td>
<input type="button" value=" - " onClick="addChar(this.form.display,
'-')">
</td>
</tr>
<tr>
<td>
<input type="button" value=" sq " onClick="if (checkNum(this.form.display.value))
{ square(this.form) }">
</td>
<td>
<input type="button" value=" 0 " onClick="addChar(this.form.display,
'0')">
</td>
<td>
<input type="button" value=" . " onClick="addChar(this.form.display,
'.')">
</td>
<td>
<input type="button" value=" +/- " onClick="changeSign(this.form.display)">
</td>
<td>
<input type="button" value=" + " onClick="addChar(this.form.display,
'+')">
</td>
</tr>
<tr>
<td>
<input type="button" value=" ( " onClick="addChar(this.form.display,
'(')">
</td>
<td>
<input type="button" value=" cos " onClick="if (checkNum(this.form.display.value))
{ cos(this.form) }">
</td>
<td>
<input type="button" value=" sin " onClick="if (checkNum(this.form.display.value))
{ sin(this.form) }">
</td>
<td>
<input type="button" value=" tan " onClick="if (checkNum(this.form.display.value))
{ tan(this.form) }">
</td>
<td>
<input type="button" value=" ) " onClick="addChar(this.form.display,
')')">
</td>
</tr>
</table>
<table BORDER="1" COLS=3 WIDTH="30%" >
<tr>
<td>
<input type="button" value=" Clear "
onClick="this.form.display.value = 0 ">
</td>
<td>
<input type="button" value=" Back
" onClick="deleteChar(this.form.display)">
</td>
<td>
<input type="button" value=" Enter " name="enter"
onClick="if (checkNum(this.form.display.value)) { compute(this.form) }">
</td>
</tr>
</table>
</form>
Paste everything into a new blank notepad document and Save As "notepad.htm"
<HTML>
<HEAD>
<TITLE>notepad</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function nameDefined(c,n) {
var s=removeBlanks(c)
var pairs=s.split(";")
for(var i=0;i<pairs.length;++i) {
var pairSplit=pairs[i].split("=")
if(pairSplit[0]==n) return true
}
return false
}
function removeBlanks(s) {
var temp=""
for(var i=0;i<s.length;++i) {
var c=s.charAt(i)
if(c!=" ") temp += c
}
return temp
}
function getCookieValue(c,n) {
var s=removeBlanks(c)
var pairs=s.split(";")
for(var i=0;i<pairs.length;++i) {
var pairSplit=pairs[i].split("=")
if(pairSplit[0]==n) return pairSplit[1]
}
return ""
}
<!--
// -->
</SCRIPT>
<SCRIPT LANGUAGE="JavaScript"><!--
function loadNotes() {
var cookie=document.cookie
if(nameDefined(cookie,"Notes")) {
notes=getCookieValue(cookie,"Notes")
notes=decode(notes)
}else notes=""
document.forms[0].notesArea.value=notes
}
function saveNotes() {
notes=window.document.forms[0].notesArea.value
notes=encode(notes)
var newCookie = "Notes="+notes+"; expires="
newCookie += "Tuesday, 08-Nov-10 23:12:40 GMT"
document.cookie=newCookie
}
function encode(s) {
t=""
for(var i=0;i<s.length;++i) {
ch=s.charAt(i)
if(ch=="/") t += "//"
else if(ch==" ") t += "/b"
else if(ch==",") t += "/."
else if(ch==";") t += "/:"
else if(ch=="\n") t += "/n"
else if(ch=="\r") t += "/r"
else if(ch=="\t") t += "/t"
else if(ch=="\b") t += "/b"
else t += ch
}
return t
}
function decode(s) {
// Decode the encoded cookie value
t=""
if(s==null) return t
for(var i=0;i<s.length;++i) {
var ch=s.charAt(i)
if(ch=="/") {
++i
if(i</SCRIPT>
</HEAD>
<BODY>
<FORM>
<P>Write some notes down that you may want to use at a later date.
These notes will be saved as a cookie on your hard drive.
</P>
<CENTER>
<INPUT NAME="save" TYPE="BUTTON" VALUE="Save Notes Now!" ONCLICK="saveNotes()">
</CENTER>
<TEXTAREA NAME="notesArea" ROWS="12" COLS="45">
</FORM>
<SCRIPT LANGUAGE="JavaScript"></SCRIPT>
</BODY>
</HTML>
Copy this script to the area that you would like and change the text within the (' ') tags only.
<script>
bVer = parseInt( navigator.appVersion );
if( navigator.appName == "Netscape" && bVer >= 3 )
{
document.write ('You are using your Netscape Verion ' + bVer);
document.write ('<P><HR>Type text or html in right here!</P>');
document.write ('<P><img src="document.gif"></P>');
}
else if( navigator.appName == "Microsoft Internet Explorer" && bVer >= 4)
{
document.write ('You have Internet Explorer ' + bVer)
document.write ('<P><HR>Type text or html in right here!</P>');
document.write ('<P><img src="clip.gif"></P>');
}
else
document.write ('I have now idea what browser you are using!!!')
</script>