Skip to content

Instantly share code, notes, and snippets.

@miketaylr
Created November 21, 2013 20:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miketaylr/7588818 to your computer and use it in GitHub Desktop.
Save miketaylr/7588818 to your computer and use it in GitHub Desktop.
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