1 Star 0 Fork 2

liweijian2017/project_2486812

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
index.html 1.25 KB
一键复制 编辑 原始数据 按行查看 历史
啃PingGuo的人儿 提交于 2017-09-16 23:53 . new projects file
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<script type="text/javascript">
var url = window.location.href;
var idx = url.indexOf('?');
var params = "";
var url
if(idx != -1){
params = url.substr(idx);
url = url.substr(0,idx);
if(url[url.length -1 ] != '/'){
url += "/";
}
}
function browserRedirect() {  
var sUserAgent = navigator.userAgent.toLowerCase();  
var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";  
var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";  
var bIsMidp = sUserAgent.match(/midp/i) == "midp";  
var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";  
var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";  
var bIsAndroid = sUserAgent.match(/android/i) == "android";  
var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";  
var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";  
if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM){  
window.location.href= url + "web-mobile/" + params;
}
else{
window.location.href= url+ "web-desktop/" + params;
}
} 
browserRedirect(); 
</script>
</body>
</html>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/liweijian2017/chengduchexuan.git
git@gitee.com:liweijian2017/chengduchexuan.git
liweijian2017
chengduchexuan
project_2486812
master

搜索帮助