How to Detect iPad and Redirect to iPad Version Website


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  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>

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.