Posted By

marcio on 05/06/09


Tagged

javascript browser iphone


Versions (?)

Who likes this?

9 people have marked this snippet as a favorite

djhamilton
danielfilho
Kraeved
umang_nine
blackabee
mahalie
seanpowell
allproweb
guo3823538


detecting iPhone with javascript


 / Published in: JavaScript
 

  1. if(navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i)){
  2. window.location = "http://marciobarrios.com/m/";
  3. }

Report this snippet  

Comments

RSS Icon Subscribe to comments
Posted By: blackabee on November 18, 2009

works great. thanks!

Posted By: parkarlsson on January 4, 2012

I've created a bit more versatile snippet here: http://snipplr.com/view/55226/detecting-ipadiphoneipod-with-javascript/ Check it out and let me know what you think.

You need to login to post a comment.