January 23, 2001 - A Short Browser Sniffer
January 23, 2001 A Short Browser Sniffer Tips: January 2001
Yehuda Shiran, Ph.D.
|
document.all
object, and by not supporting the document.getElementById method
. Netscape Navigator 4.x is recognized by having the document.layers
object. Internet Explorer 5.x has the document.all
object and supports the document.getElementById
method. Netscape 6 supports the document.getElementById
method and does not have the document.all
object. Here is the code:
var IE4 = (document.all && !document.getElementById) ? true : false;
var NS4 = (document.layers) ? true : false;
var IE5 = (document.all && document.getElementById) ? true : false;
var N6 = (document.getElementById && !document.all) ? true : false;
Click the button below to find the browser name: