Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@karlcow
Created August 20, 2013 15:35
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 karlcow/6283098 to your computer and use it in GitHub Desktop.
Save karlcow/6283098 to your computer and use it in GitHub Desktop.
Detection on movistar.com.ve
var elemHeight = document.documentElement.clientHeight;
var mobile = (/iphone|ipod|android|blackberry|mini|windows\sce|palm/i.test(navigator.userAgent.toLowerCase()));
if (mobile) {
var userAgent = navigator.userAgent.toLowerCase();
if ( (userAgent.search("android") > -1) && (userAgent.search("mobile") > -1) && ( ((screen.width==800)&&((screen.height<=1140)||(screen.height>=500)))||((screen.width==0)&&(screen.height==0)) ) ){
document.location = "/particulares/m/default.asp";
}
if ( (userAgent.search("android") > -1) && (userAgent.search("mobile") > -1) && ( (screen.width==800)&&(((screen.height>=570 )&&(screen.height<=580)) || ((screen.height>=358)&&(screen.height<=361)) || (screen.height==1130) || (screen.height==1131)) ) ){
document.location = "/particulares/m/default.asp";
}else{
if (userAgent.search("android") > -1){
var str=navigator.userAgent;
var n=str.search("Fennec");
if(n!=-1){
document.location = "/particulares/default.asp";
}else{
var n2=str.search("Opera");
if(n2!=-1){
document.location = "/particulares/default.asp";
}else{
var n3=str.search("LG");
if(n3!=-1){
document.location = "/particulares/m/default.asp";
}
if( (screen.width==800)&&( ((screen.height>=1180)&&(screen.height<=1330)) || ((screen.height>=391)&&(screen.height<=668)) ) ){
document.location = "/particulares/default.asp";
}
if( (screen.width==1280) && ( (screen.height>=212)||(screen.height<=496) ) ){
document.location = "/particulares/default.asp";
}
}
}
}
}
if(navigator.platform=='ipod'){
document.location = "/particulares/m/default.asp";
}
if(navigator.platform=='blackberry'){
document.location = "/particulares/m/default.asp";
}
if(navigator.platform=='iphone'){
document.location = "/particulares/m/default.asp";
}
if(navigator.platform!="Linux armv7l"){
document.location = "/particulares/m/default.asp";
}
}else{
if ((navigator.platform=="Series60")||(navigator.platform=="Nokia_Series_40")||(navigator.platform=="Symbian")){
document.location = "/particulares/m/default.asp";
}else{
document.location = "/particulares/default.asp";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment