Previous Example-|-Next Example (2-12A)-|-Return to Chapter Listing

Example 2.12:
Automatically Forwarding--With a Confirm Dialog Box


If you you didn't see a Confirm message box when you arrived at this page, your browser isn't JavaScript-enabled. (Maybe you have turned JavaScript off in the preferences--in Netscape Navigator select Options|Security Preferences, click on the General tab, and make sure that the Disable JavaScript check box is cleared.) The script in this page automatically forwards the browser to another document.

This is the script we used: <SCRIPT LANGUAGE="JavaScript"> <!-- function redirect() { if (confirm ("The Web page has been moved. Please bookmark the new page, and ask the owner of the page you've come from to change the link. Click on OK to continue to the new page.")) { location='2-12a.htm' } } <!--End--> </SCRIPT>
Previous Example-|-Next Example (2-12A)-|-Return to Chapter Listing