Skip to content

Instantly share code, notes, and snippets.

@timothyclifford
Created July 24, 2011 02:25
Show Gist options
  • Save timothyclifford/1102131 to your computer and use it in GitHub Desktop.
Save timothyclifford/1102131 to your computer and use it in GitHub Desktop.
Detecting iPhone & iPad using Javascript
if ((navigator.userAgent.indexOf('iPhone') != -1) || (navigator.userAgent.indexOf('iPod') != -1) || (navigator.userAgent.indexOf('iPad') != -1))
{
// Do something for iPhone / iPad / iPod here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment