priore

Detecting iOS devices

May 21st, 2012
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var deviceAgent = navigator.userAgent.toLowerCase();
  2. var iOS = deviceAgent.match(/(iphone|ipod|ipad)/);
  3.        
  4. if (iOS) {
  5.    // iOS
  6. } else {
  7.   // not iOS
  8. }
Advertisement
Add Comment
Please, Sign In to add comment