You also can use the location object to redirect a browser as soon as a page loadsfor example, to a page with browser-specific code. We saw how to do that in Chapter 4 as wellthis is Listing 04-09.html on the web site (note that this code also redirects browsers that don't support scripting using a <META> element): <HTML> <HEAD> <TITLE>Redirecting Browsers</TITLE> <SCRIPT LANGUAGE="JavaScript"> <!-- if (navigator.appName == "Microsoft Internet Explorer") { window.location.href="IE.html" } if(navigator.appName == "Netscape") { window.location.href="NS.html" } //--> </SCRIPT> <META HTTP-EQUIV="refresh" CONTENT="0; URL=default.html"> </HEAD> <BODY> <H1>Redirecting Browsers</H1> </BODY> </HTML> |