Browser detection using Bowser.js
jQuery has provided support to detect browser up to 1.8 version event it is deprecated from 1.3 but from 1.9 version browser support is removed from jQuery.If needed, we can use jQuery Migrate plugin, it is available in jQuery Migrate plugin.
From jQuery 1.9 Upgrade Guide
The jQuery.browser() method has been deprecated since jQuery 1.3 and is removed in 1.9. If needed, it is available as part of the jQuery Migrate plugin. We recommend using feature detection with a library such as Modernizr.
Source:http://jquery.com/upgrade-guide/1.9/#jquery-browser-removed
What is Bowser.js?
Bowser.js is a JavaScript library which provides us an option to detect the browser details. We can use bowser object which provides us browser details. You can use bowser.js to detect browser details without jQuery.Bowser option gives us three important details as shown in image below
- Browser version
- Browser name
- Browser engine type
Sample code snippet is given below
You can find the documentation at https://github.com/ded/bowser
Demo using JSFiddle
Browser detection using Bowser.js
Reviewed by Unknown
on
14 March, 2016
Rating:
No comments: