/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var agent = navigator.userAgent.toLowerCase(); var iphone = (agent.indexOf('iphone')!=-1); var android = (agent.indexOf('android')!=-1); var blackberry = (agent.indexOf('blackberry')!=-1); var ipad = (agent.indexOf('ipad')!=-1); if (iphone) { document.location.href="http://envivo.13.cl/iphone"; } if (android) { document.location.href="http://envivo.13.cl/android"; } if (blackberry) { document.location.href="http://envivo.13.cl/blackberry"; } if (ipad) { //document.location.href="http://envivo.13.cl/ipad"; }