手机端跳转PC端代码修改 悬赏6元 已结束
这段代码是网上找的,可以实现手机端跳转PC端,但是使用手机端打开它就一直在跳转中,麻烦把这段代码改成如果使用电脑端,则跳转到电脑端的网页,其余多的代码给删除下,谢谢了
<script>
if(/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE|Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent))){
window.location.href="/m/view.php?aid={dede:field.id/}";
}else{
window.location.href="/{dede:field.id/}.html";
}
</script>
function GetUrlRelativePath(){
var url = ();
var arrUrl = ("//");
var start = arrUrl[1].indexOf("/");
var relUrl = arrUrl[1].substring(start);//stop省略,截取从start开始到结尾的所有字符
if(("?") != -1){
relUrl = ("?")[0];
}
return relUrl;
}
function mobile_device_detect(url)
{
var thisOS=
var os=new Array("iPhone","iPod","iPad","android","Nokia","SymbianOS","Symbian","Windows Phone","Phone","linux armv71","MAUI","UNTRUSTED/","Windows CE","BlackBerry","IEMobile");
for(var i=0;i
var mobileAgent = new Array("iphone", "ipod", "ipad", "android", "mobile", "blackberry", "webos", "incognito", "webmate", "bada", "nokia", "lg", "ucweb", "skyfire");
var browser = ();
var iSMObile = false;
for(var i=0; i