January 24, 2000 - Version Detection
January 25, 2000 Version Detection Tips: January 2000
Yehuda Shiran, Ph.D.
|
navigator
object's appVersion
property. If we print this property from Internet Explorer, it looks like this:
The printout from Netscape Navigator will look like this:
Notice that Internet Explorer shows two versions, 4.0
and 5.0
in the example above. The Compatible Version (4.0
) denotes the previous compatible version. The other version (5.0
) denotes the actual version of the browser. Netscape Navigator shows just one number, the current version number (4.08
). So how do we extract the version? If we are interested in the compatible version (4.0
), then we can use the parseFloat()
method. It always returns the compatible version on the Internet Explorer and the normal browser version on Netscape Navigator. If you need the browser version in Internet Explorer, you have to resort to the indexOf()
method. Use it to locate specific substrings and then convert them to float. Check your browser's version now:
Learn more about the appVersion
property in Jan 14, 2000's tip.