后退 刷新 前进 收藏 顶部 |   知道 黑匣子 富媒体 技术服务

JS手机通用代码跳转代码

服务器应用 手机 ... (shuke.2013-08-16 09:32)


用手机看电脑网站表示很有压力,就JS来判断跳转吧!
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>手机通用代码测试</title>
</head>
<body>
<script type="text/javascript">
//平台、设备和操作系统
var system ={
win : false,
mac : false,
xll : false,
ipad : false,
iphone : false
};
//检测平台
var p = navigator.platform;
system.win = p.indexOf("Win") == 0;
system.mac = p.indexOf("Mac") == 0;
system.x11 = (p == "X11") || (p.indexOf("Linux") == 0);
system.ipad = p.indexOf("iPad") == 0;
system.iphone = p.indexOf("iPhone") == 0;
if(system.win||system.mac||system.xll){
	document.write("你用的是WIN OR MAC OR XLL");
}else if(system.iphone){
	//window.location.href = 'http://www.coolneng.com';
	document.write("用Iphone系列毫无压力");
}else{
	//window.location.href = 'http://www.xinxiamedia.com';
	document.write("安卓系统表示有压力");
}
</script>
</body>
</html>


2 楼 shuke[2013-08-16 10:21]
企鹅的跳转代码
<script type="text/javascript"> 
	var strURL=window.location.href; //;"http://view.news.qq.com/intouchtoday/index.htm?2489" 
    var str_t=parseInt(strURL.split("?")[1]);
    //var str_t=str_t[0].split("#");
    var iphoneUrl = "http://shipei.qq.com/c/viewview/"+str_t+"/TPC"+str_t+"#TencentContent";
    if(/iphone|nokia|sony|ericsson|mot|samsung|sgh|lg|philips|panasonic|alcatel|lenovo|cldc|midp|wap|android|iPod/i.test(navigator.userAgent.toLowerCase())){ 
         document.location.href = iphoneUrl;
    }
</script>


进度:100% 返回服务器应用

IIS启动GZIP进行对网站压缩时,无法编辑metabase.xml的解决办法.(舒克)

图片新热点

导航


目录


    站内搜索
    首页 | W3C | ME