136Part IIJavaScript (Abyss web server) Tutorial// controller functions (disabled) function playIt()

136Part IIJavaScript Tutorial// controller functions (disabled) function playIt() { } function stopIt() { } function pauseIt(){ } function rewindIt() { }


Jukebox Controls
I surround each image in the document with a link because the link object has the event han- dlers needed to respond to the mouse rolling over the area for compatibility back to NN3. Each link s onmouseoverevent handler calls the imageOn()function, passing the name of theimage object to be swapped. Because both the onmouseoverand onmouseoutevent handlersrequire a returntruestatement to work in older browsers, I combine the second functioncall (to setMsg()) with the returntruerequirement. The setMsg()function alwaysreturns trueand is combined with the returnkeyword before the call to the setMsg()func- tion. It s just a trick to reduce the amount of code in these event handlers. If you are typing this listing to try it out, be sure to keep each entire tag and its attributesin one unbroken line; or insert a carriage return beforeany event handler name.

Note