You may want to know the details of the browser used by the various visitors to your site. Lets see how the navigator object can be used to identify the browser details of the user. The navigator object has a property named ‘appName’ which will do the trick.The code below is all that is needed:
navigator.appName
For Ex.
function identifyBrowser()
{
alert(“You seem to be working on the “+navigator.appName+” browser”);
}
The navigator method has a few other properties like:
appCodeName
appVersion
language
mimeTypes[]
platform
plugins[]
userAgent
I will be frequenting this blog now more often. So much to learn.
Why would any1 be interested to know what browser a visitor is using?
@kiran thanks for visiting this blog
About your question, I’ll tell you where I used it.
There was this add-on that needed to be installed.
The add-on was available for Internet Explorer as well as Firefox. But the method to install the add-on was different for both the browsers. So, I thought of identifying which browser the user was using and if it was either of the two for which the add-on was available then I would display the appropriate steps needed to install it