/*
Mastering JavaScript, Premium Edition
by James Jaworski
ISBN:078212819X
Publisher Sybex CopyRight 2001
*/
<HTML>
<HEAD>
<TITLE>Handling load events in a layout document</TITLE>
<SCRIPT LANGUAGE="JavaScript"><!--
function selectFrames(){
base="frames/"
newFrames=new Array("red.htm","yellow.htm","blue.htm","green.htm","white.htm")
window.firstFrame.location=base+newFrames[Math.round(5*Math.random())%5]
window.secondFrame.location=base+newFrames[Math.round(5*Math.random())%5]
}
//-->
</SCRIPT>
</HEAD>
<FRAMESET
COLS="*,*" ONLOAD="selectFrames()" ONUNLOAD="alert('Thanks for stopping by!')">
<FRAME SRC="frames/grey.htm" NAME="firstFrame">
<FRAME SRC="frames/grey.htm" NAME="secondFrame">
</FRAMESET>
</HTML>
|