detect iphone, ipad or ipod via js


/ Published in: JavaScript
Save to your folder(s)

Was using this to disable certain js functionality as it wasnt working on apple\'s webkit


Copy this code and paste it in your HTML
  1. function appleMobileChk(){
  2. if (/iPhone/.test(navigator.userAgent) || /iPad/.test(navigator.userAgent) || /iPod/.test(navigator.userAgent)){
  3. return true;
  4. }
  5. else{
  6. return false;
  7. }
  8. }

Report this snippet


Comments


You need to login to view comments.