Posted By

vaughanj on 04/06/13


Tagged

redirect ipod iPad ios


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

imoddesign
lionminister
Beppoi


Detect iOS devices and redirect


 / Published in: JavaScript
 

Detect if iPad / iPhone / iPod via the user agent and redirect to another page.

  1. <script type="text/javascript"> // <![CDATA[
  2. if ((navigator.userAgent.indexOf('iPhone') != -1) || (navigator.userAgent.indexOf('iPod') != -1) || (navigator.userAgent.indexOf('iPad') != -1)) {
  3. document.location = "http://www.scottrockers.com/iphone.html";
  4. } // ]]>
  5. </script>

Report this snippet  

You need to login to post a comment.