Skip to content

Instantly share code, notes, and snippets.

@craiem
Forked from keriati/detectMobile.js
Created March 24, 2013 01:06
Show Gist options
  • Save craiem/5229980 to your computer and use it in GitHub Desktop.
Save craiem/5229980 to your computer and use it in GitHub Desktop.
js -> DetectMobile
// Bad practice!
function detectMobile() {
return (/iphone|ipad|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment