Created
September 1, 2014 16:11
-
-
Save jonaharagon/467eb32fcc4b0503e243 to your computer and use it in GitHub Desktop.
Redirect Mobile Websites
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
if( /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ) { | |
window.location = "CHANGE THIS TO MOBILE SITE"; | |
} | |
</script> | |
<script>// <![CDATA[ | |
if (screen.width <= 800) { | |
document.location = "CHANGE THIS TO MOBILE SITE"; | |
} | |
// ]]></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment