Previous Example-|-Next Example-|-Return to Chapter Listing

Example 12.4:
onload: Asking the User Where to Go


We used the onload event handler to run the confirmEntry() function which displayed the Confirm dialog box.

This is the script we used: <SCRIPT LANGUAGE="JavaScript"> <!-- function confirmEntry() { if (confirm("As you have a JavaScript browser, you can go to our JavaScript enabled site. Click on OK to do so, or click on Cancel to remain at this (non-JavaScript) page.")) { location='12-4a.htm' } } //--> </SCRIPT> </HEAD> <BODY onload="confirmEntry()">
Previous Example-|-Next Example-|-Return to Chapter Listing