Getting Browser details and Version Detection using JavaScript

Submitted by Xfunda - excellent fundamental » In this article we will go to get browser details of the web browser using JavaScript. We are going see how to get it. We can used that data to store in database and used for analyze it, we can modify our site structure to make it more compatible with different version of web browser. Here we are not going to store it in database, we just going to display it in web browser itself. Here navigator object will play an important role. The navigator Object describes more modern ways to accomplish it.
Rating: 2.0/5 | 223 clicks | 1 comment | 1 save | share | report

Comments on this tutorial

ChrisDaemonApril 11, 2008

Here we are wasting our time.
USER-AGENTS are next to useless, since you can change them. I recommend analyzing the user-agent string on the server side. Using Javascript for that adds to the complexity and introduces another point of FAIL.
Conditional output/functionality depending on browser may sound intriguing, but it's the wrong approach. I would use such distinction if really necessary, say, for the XMLHttpRequest, or for embedding ActiveX vs working technology.

The Navigator object is by far not a modern way. It may be a tried way, but it's been around for years, and not part of the DOM.

If you are writing different sites for different browsers... you should google to find "Morons in Webspace"

Discuss this tutorial

You must be logged in to comment on a tutorial.