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

5. Browser Feature Detection > 5.4. Detecting the Netscape Navigator Version

Detecting the Netscape Navigator Version

NN 2 , IE n/a

Problem

You want script execution to branch based on a specific or minimum version of Netscape Navigator.

Solution

For versions prior to Netscape 6, the most easily accessed version information is at the start of the navigator.appVersion property value. Starting with Netscape 6, however, the version information is contained in a new property of the navigator object: vendorSub. Here’s a function that returns a numeric value of the Navigator version from any generation:

function getNNVersionNumber( ) {
    if (navigator.appName =  = "Netscape") {
        var appVer = parseFloat(navigator.appVersion);
        if (appVer < 5) {
            return appVer;
        } else {
            if (typeof navigator.vendorSub != "undefined") {
                return parseFloat(navigator.vendorSub);
            }
        }
    }
    return 0;
}

PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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