Posted By

robnilas on 01/21/17


Tagged

mobile-redirection


Versions (?)

Detecting and Redirecting Mobile Users


 / Published in: JavaScript
 

  1. <script type="text/javascript">
  2. <!--
  3. if (screen.width <= 699) {
  4. document.location = "mobile.html";
  5. }
  6. //-->
  7. </script>
  8.  
  9.  
  10. <script language=javascript>
  11. <!--
  12. if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) {
  13. location.replace("http://url-to-send-them/iphone.html");
  14. }
  15. -->
  16. </script>

Report this snippet  

You need to login to post a comment.