![]() | ![]() | ||||||||
| | #1 |
| Mobile Site Wizzard! War Room Member Join Date: Nov 2010 Location: Scottsdale / Santa Monica
Posts: 173
Thanks: 4
Thanked 29 Times in 20 Posts
|
hey buddies, Just shared this on someone else's thread, but im sure everyone could use it. Its used to detect mobile users on a desktop site and redirect them to a mobile site at a specific URL. Enjoy: Just copy paste this code in between the <header>...</header> tags on the page you want to detect and redirect. Also change the "http://www.gomobileenterprise.com" to whatever your mobile site URL is. ![]() HTML Code: <script> function detect() { var uagent = navigator.userAgent.toLowerCase(); var mobile = false; var search_strings = [ "iphone", "ipod", "ipad", "series60", "symbian", "android", "windows ce", "windows7phone", "w7p", "blackberry", "palm" ]; for (i in search_strings) { if (uagent.search(search_strings[i]) > -1) mobile = true; } return mobile; } if (detect()) window.location = "http://gomobileenterprise.com/"; </script> |
| | |
| | |
| | #2 |
| Active Warrior Join Date: Oct 2006 Location: , , .
Posts: 51
Thanks: 4
Thanked 3 Times in 3 Posts
|
Thank you for this script, nice share
|
|
Become a Profitable Trader with an Amazing and Easy-To-Learn System. Forex Power Trading System | |
| | |
![]() |
|
| Bookmarks |
| Tags |
| buddies, detect, device, free, mobile, redirect, script, warrior |
| Thread Tools | |
| |
![]() |