Created
July 26, 2013 10:24
-
-
Save atatos/6087850 to your computer and use it in GitHub Desktop.
Detecting browsers in jQuery 1.9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Bring back the browser object | |
jQuery.browser = {}; | |
//Rest all is self explanatory. | |
jQuery.browser.mozilla = /mozilla/.test(navigator.userAgent.toLowerCase()) | |
&& !/webkit/.test(navigator.userAgent.toLowerCase()); | |
jQuery.browser.webkit = /webkit/.test(navigator.userAgent.toLowerCase()); | |
jQuery.browser.opera = /opera/.test(navigator.userAgent.toLowerCase()); | |
jQuery.browser.msie = /msie/.test(navigator.userAgent.toLowerCase()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment