The navigator Object

The navigator object, also called the clientInformation object in IE4+, refers to the browser itself. In early versions of the Netscape Navigator, the navigator object actually functioned as the top-level object, although that role has now been taken over by the window object. As we’ve already seen in earlier chapters, the navigator object is often a very useful one in cross-browser programming. We’ve used the navigator object’s appName, appVersion, and userAgent properties to get information about the browser as far back as Chapter 1, “Essential JavaScript,” as with this script (Listing 01-07.html on the web site) which displays the values of those properties: