Reputation: 444
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..
Upvotes: 1
Views: 1198
Reputation: 30922
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.
Upvotes: 1
Reputation: 22668
Are you thinking of detection on the server side? For PHP there is this.
Upvotes: 0
Reputation: 2331
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
Upvotes: 0
Reputation: 944256
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.
Upvotes: 1