Last active
October 8, 2019 06:19
-
-
Save mohsinworld/1d4c1352061f04e9ae3a3c502d8bf7f7 to your computer and use it in GitHub Desktop.
This file contains 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 type="text/javascript"> | |
<!-- | |
if (screen.width <= 699) { | |
document.location = "https://mohsinalam.com/mobile/"; | |
} | |
//--> | |
</script> | |
"https://mohsinalam.com/mobile/" would be replaced with the location of wherever your mobile version resides. This technique could be adapted to load an alternate stylesheet as well. | |
For iPhones/iPods Specifically | |
<script language=javascript> | |
<!-- | |
if ((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i))) { | |
location.replace("https://mohsinalam.com/iphone/"); | |
} | |
--> | |
</script> | |
To PC redirect to main homepage | |
<script type="text/javascript"> | |
<!-- | |
if (screen.width >= 699) { | |
document.location = "https://mohsinalam.com"; | |
} | |
//--> | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment