Because of browser incompatibility issue in DHTML, some web developers make two versions of their site, one that is compatible with Internet Explorer and the other that contains Netscape Navigator specific code. These developers use a browser detection script to transfer the visitor to the respective site.
We’ll concentrate only on Internet Explorer and Netscape Navigator since they are the most prominent browsers on the Internet.
To automatically transfer the visitor, we have to take the help of location property of the window object. Let’s look at the code.
The browser name is obtained through navigator.appName and is stored in variable bname. Using an if statement we check the value of this variable. If it’s “Microsoft Internet Explorer”, we transfer the visitor to explorer_version.html else, the visitor is taken to netscape_version.html. Note that window.location takes a URL as value.
Digital Equipment Corporation (DEC) created the once popular Altavista Internet search engine. They were also the first computer vendor to launch a public web site at dec.com. Their domain name is the fifth oldest in the world and, at one time, hosted a popular software repository. [more...]