Posted By

Nanobyte on 05/29/09


Tagged

javascript detection iphone ipod touch


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

Nanobyte
umang_nine


iPhone/iPod Touch detection


 / Published in: JavaScript
 

  1. if(window.navigator.userAgent.match(/(CPU iPhone OS)/))
  2. document.write('This is a iPhone or iPod Touch!');
  3. else
  4. document.write('This is NOT a iPhone or iPod Touch!');

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: parkarlsson on January 4, 2012

Try this snippet in order to detect iPod, Iphone and iPad in javascript: http://snipplr.com/view/55226/detecting-ipadiphoneipod-with-javascript/

You need to login to post a comment.