威尼斯赌博游戏

手机端电脑端互转JS代码

来源: www.zngps.com| 2017-12-12 23:22
var browser={  
        versions:function(){   
               var u = navigator.userAgent, app = navigator.appVersion;   
               return {//移动终端浏览器版本信息   
                    trident: u.indexOf('Trident') > -1, //IE内核  
                    presto: u.indexOf('Presto') > -1, //opera内核  
                    webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核  
                    gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核  
                    mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端  
                    ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端  
                    android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器  
                    iPhone: u.indexOf('iPhone') > -1 , //是否为iPhone或者QQHD浏览器  
                    iPad: u.indexOf('iPad') > -1, //是否iPad    
                    webApp: u.indexOf('Safari') == -1, //是否web应该程序,没有头部与底部  
                    weixin: u.indexOf('MicroMessenger') > -1, //是否微信   
                    qq: u.match(/\sQQ/i) == " qq" //是否QQ  
                };  
             }(),  
             language:(navigator.browserLanguage || navigator.language).toLowerCase()  
    }   
      
      if(browser.versions.mobile || browser.versions.ios || browser.versions.android ||   
        browser.versions.iPhone || browser.versions.iPad){        
            window.location = "http://www.luyouqiwo.com/wap"+window.location.pathname;      
      }
	  
var str=window.location.href;
str = str.substr(str.indexOf('wap'), str.indexOf('l'));
str=(str.slice(3));
	  var system = {};
var p = navigator.platform;
var u = navigator.userAgent;

system.win = p.indexOf("Win") == 0;
system.mac = p.indexOf("Mac") == 0;
system.x11 = (p == "X11") || (p.indexOf("Linux") == 0);
if (system.win || system.mac || system.xll) {//如果是PC转 
    if (u.indexOf('Windows Phone') > -1) {  //win手机端

    }
    else {
	

        window.location.href = "http://www.luyouqiwo.com/"+str;
    }
}

猜你喜欢
推荐
随机推荐
相关文档
Top
Baidu