• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

5. Browser Feature Detection > 5.2. Detecting an Early Browser Version

Detecting an Early Browser Version

NN 2, IE 3

Problem

You want script execution to branch based on an early version of the browser.

Solution

For mainstream browsers through Version 4, the navigator.appVersion property returns the complete version of the browser along with further information about the operating system platform. To determine the major generation of the browser, use the parseInt( ) function to extract the integer value of the version:

var isVer4 = (parseInt(navigator.appVersion) =  = 4);

To get the version number that includes incremental upgrades of the browser (represented as numbers to the right of the decimal, such as 4.74), use the parseFloat( ) function:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint