JS - iPad User Agent Detection


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



Copy this code and paste it in your HTML
  1. // For use within normal web clients
  2. var isiPad = navigator.userAgent.match(/iPad/i) != null;
  3.  
  4. // For use within iPad developer UIWebView
  5. // Thanks to Andrew Hedges!
  6. var ua = navigator.userAgent;
  7. var isiPad = /iPad/i.test(ua) || /iPhone OS 3_1_2/i.test(ua) || /iPhone OS 3_2_2/i.test(ua);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.