Created
August 1, 2012 18:16
-
-
Save ericrallen/3229434 to your computer and use it in GitHub Desktop.
JavaScript UA Checker, modified from http://bit.ly/nMEXh4 to represent ipad, as well.
This file contains 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
//check for mobile devices | |
//modified from http://bit.ly/nMEXh4 | |
var ua = navigator.userAgent; | |
var checker = { | |
iphone: ua.match(/(iPhone|iPod)/), | |
ipad: ua.match(/(iPad)/), | |
blackberry: ua.match(/BlackBerry/), | |
android: ua.match(/Android/) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment