1

Identifying the version of a browser using JavaScript is quite straight forward.

Is there any way to identify the browser version without using JavaScript libraries??

I just felt that there should be some way to identify the browser version without using any external libraries. I'm just very much curious to know if there is any way to do so..

13
  • 4
    Is there a reason you need to know what version of a browser someone is using? Commented Nov 14, 2011 at 16:19
  • You'll need to be more specific with what you would like to do with this. There are ways of targeting CSS at certain browsers. Commented Nov 14, 2011 at 16:19
  • 1
    This question makes no sense to me. What would you do with a browser version without javascript. Acting on a browser version (to do something based on which browser version is way) requires logic which requires a programming language of some kind. IE has conditional comments. Is that what you want? Commented Nov 14, 2011 at 16:20
  • What is the purpose of identifying the browser, styling? Commented Nov 14, 2011 at 16:20
  • 2
    It's "JavaScript", not "Java script", "javascript", or "java script", all of which you had in your question. (I think that's a record, literally every place you mentioned it you wrote it slightly differently...) :-) Commented Nov 14, 2011 at 16:21

5 Answers 5

1

If you're wanting to do this client-side, then you certainly can use javascript. However this is also trivial with most server-side languages. All you need is access to the User Agent HTTP header.

Sign up to request clarification or add additional context in comments.

1 Comment

So according to your answer its almost compulsory to use javascript to identify browser version and type on client side.
1

Most libraries just parse the user-agent string, which is sent to the server as an HTTP header, so any server side process could do it.

The usual warnings about browser sniffing being unreliable, hard to maintain, and usually the wrong solution to any given problem apply.

Comments

1

The http request contains the header User-Agent

Comments

0

You can include conditional comments in your HTML to select versions of IE, but as far as I know, it doesn't work for other browsers. http://www.positioniseverything.net/articles/cc-plus.html

Comments

0

Are you thinking of detection on the server side? For PHP there is this.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.