Hello There, Guest! Login Register


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Redirect Mobile Devices New Code
#1
Code:
<script type="text/javascript">function RedirectSmartphone(url){
   if (url && url.length > 0 && IsSmartphone())
   window.location = url;
}
function IsSmartphone(){
   if (DetectUagent("android")) return true;
   else if (DetectUagent("iphone")) return true;
   else if (DetectUagent("ipod")) return true;
   else if (DetectUagent("symbian")) return true;
   return false;
}
function DetectUagent(name){
   var uagent = navigator.userAgent.toLowerCase();
   if (uagent.search(name) > -1)
   return true;
   else
   return false;
}
RedirectSmartphone("http://www.your-redirect-link.com");
</script>
 
Reply
  


Forum Jump:


Browsing: 1 Guest(s)