Skip to content

Instantly share code, notes, and snippets.

@hunk
Created May 21, 2012 22:05
Show Gist options
  • Select an option

  • Save hunk/2764992 to your computer and use it in GitHub Desktop.

Select an option

Save hunk/2764992 to your computer and use it in GitHub Desktop.
JavaScript for detecting iOS devices
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