Posted By

garretjames on 03/31/11


Tagged

iPad useragent


Versions (?)

JS - iPad User Agent Detection


 / Published in: JavaScript
 

  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  

You need to login to post a comment.