Created
May 21, 2012 22:05
-
-
Save hunk/2764992 to your computer and use it in GitHub Desktop.
JavaScript for detecting iOS devices
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
| var deviceAgent = navigator.userAgent.toLowerCase(); | |
| var iOS = deviceAgent.match(/(iphone|ipod|ipad)/); | |
| if (iOS) { | |
| // iOS | |
| } else { | |
| // not iOS | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment