spacer
Yehuda Shiran February 22, 2000
Detecting IE 5.5
Tips: February 2000

Yehuda Shiran, Ph.D.
Doc JavaScript

Developer News
Microsoft Shows Off Silverlight 4, IE9 Plans
Metasploit Expands Vulnerability Test Framework
HyperCard Reborn?

Internet Explorer is going to be released within a few months. The beta version is already out. The new version includes many new features that we will cover in our columns. To take advantage of the new features, and still be compatible with Internet Explorer 5.0, you need to be able to detect the new version.

As usually, the key is in the navigator.appVersion property. In Internet Explorer 5.5, for example, this property looks like this:

4.0 (compatible; MSIE 5.5; Windows 98)

To extract the string "5.5", we would first get the position of "MSIE":

navigator.appVersion.indexOf("MSIE")

Then add 5 to get to the position of "5.5":

msieIndex = navigator.appVersion.indexOf("MSIE") + 5;

Then extract the three-character-long substring beginning at msieIndex:

navigator.appVersion.substr(msieIndex,3)

Finally, convert the string to a floating number:

parseFloat(navigator.appVersion.substr(msieIndex,3))


People who read this tip also read these tips:

Look for similar tips by subject:

internet.commediabistro.comJusttechjobs.comGraphics.com

Search:

WebMediaBrands Corporate Info

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | Shopping | E-mail Offers | Freelance Jobs

webref The latest from WebReference.com Browse >
Rolling Out Your Own HTML Application Version Control · HTML 5: Client-side Storage · Working with Ajax Server Extensions
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Wi-Fi Product Watch, November 2009 · Chip Market Recovering From '08 Collapse · Low-Cost Tools to Kickstart Your New Business