JavaScript Browser Detection
The Navigator object contains information about the visitor's browser.
Browser Detection
Almost everything in this tutorial works on all JavaScript-enabled browsers. However, there are some things that just don't work on certain browsers - especially on older browsers.
So, sometimes it can be very useful to detect the visitor's browser, and then serve up the appropriate information.
The best way to do this is to make your web pages smart enough to look one way to some browsers and another way to other browsers.
The Navigator object can be used for this purpose.
The Navigator object contains information about the visitor's browser name, version, and more.
Note: There is no public standard that applies to the navigator object, but all major browsers support it.
The Navigator Object
The Navigator object contains all information about the visitor's browser. We are going to look at two properties of the Navigator object:
appName - holds the name of the browser
appVersion - holds, among other things, the version of the browser