Assignment 7: A Possible Answer

Run your mouse over this link


Here's the script that did it:



<body bgcolor="FFFFCC" onUnload="goodbyedate()">

<A HREF="thanksalot.html" onMouseOver="window.status='Hey ' +navigator.appName+ ' user - click here!'; return true" onMouseOut="window.status='You should leave ' +document.location+ ' right away.'; return true">Run your mouse over this link</A>

 

     The onMouseOver and onMouseOut commands are basically the same as shown in the tutorial, except I called for the "navigator.appName" in the onMouseOver, then called for the "document.location" in the onMouseOut. The trick to this long line is where to place all the single and double quotes. Notice the pattern above -- each of the "window.status" commands is surrounded in double quotes. The text bits inside then use single quotes. Just be careful to end all single and double quotes and you shouldn't have much trouble.

     The alert box was created by an onUnload command in the BODY flag.

 

Did You Get It?

 

Back to the Index Page