Posted By

peterbelsky on 12/12/10


Tagged


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

kwameboame
cappellin
dms224
Priestd09


How to Detect iPad and Redirect to iPad Version Website


 / Published in: JavaScript
 

URL: http://scottrockers.com/blog/resources/simple-code-tricks/how-to-detect-ipad-and-redirect-to-ipad-version-website

  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.