Created
November 21, 2013 20:15
-
-
Save miketaylr/7588818 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
function Redireciona() { | |
var ua = navigator.userAgent.toLowerCase(); | |
if (((navigator.appVersion.indexOf("MSIE") > 0) && (navigator.appVersion.indexOf("Windows CE") > 0)) || (navigator.appVersion.indexOf("240x320") > 0)) | |
{ | |
var detect = navigator.userAgent.toLowerCase(); | |
if (detect.indexOf("smartphone") + 1) { | |
window.top.location = "http://www.itau.com.br/mobile"; | |
} | |
else { | |
window.top.location = "http://www.itau.com.br/mobile"; | |
//window.top.location = "http://www.itau.com.br/pda/index.html"; | |
} | |
} | |
else if (navigator.userAgent.indexOf("iPhone") != -1 || navigator.userAgent.indexOf("iPod") != -1) | |
{ | |
ref = document.referrer; | |
posicao1 = ref.indexOf("http://itau.mobi/"); | |
posicao2 = ref.indexOf("https://ww70.itau.com.br/m/"); | |
if ((posicao1 == -1) && (posicao2 == -1)) { | |
window.top.location = "http://www.itau.com.br/mobile"; | |
} else var browser = new Browser(); | |
} | |
else if (window.innerWidth + "x" + window.innerHeight == "688x553") { | |
window.top.location = "http://www.itau.com.br/mobile"; | |
//window.top.location = "http://www.itau.com.br/palm/index.html"; | |
} | |
else if (navigator.userAgent.indexOf("BlackBerry") != -1) { | |
window.top.location = "http://www.itau.com.br/mobile"; | |
} | |
else if (ua.indexOf("android") != -1) { | |
window.top.location = "http://www.itau.com.br/mobile"; | |
} | |
else if (ua.indexOf("windows phone") != -1) { | |
window.top.location = "http://www.itau.com.br/mobile"; | |
} | |
else if (ua.indexOf("iemobile 8") != -1) { | |
window.top.location = "http://www.itau.com.br/mobile"; | |
} | |
else if (ua.indexOf("nokiae71") != -1) { | |
window.top.location = "http://www.itau.com.br/mobile"; | |
} | |
else if (ua.indexOf("symbian") != -1) { | |
window.top.location = "http://www.itau.com.br/mobile"; | |
} | |
else if (ua.indexOf("nokia") != -1) { | |
window.top.location = "http://www.itau.com.br/mobile"; | |
} | |
else { | |
var browser = new Browser(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment