Browser (and browser version) detection is an “all time classic” development requirement. jQuery.browser WAS an excellent solution, but it was removed in jQuery 1.9.
Bowser – A Browser detector
Get bowser from https://github.com/ded/bowser. Add it to your document with something like this (change /url/to/… with the real url):
The HTML part
Let’s create these links for demo:
Click to <a id="detect_browser"
Click to <a id="detect_version"
// detect browser properties
alert(JSON.stringify(bowser, null, ' '));
// detect browser version
If you need help on
JSON.stringify, read this post.
From jQuery docs
- jQuery.browser (This property was removed in jQuery 1.9)
Browser Feature detection solutions