做网站首页制作手机端浏览的跳转
时间:2014-05-09 01:20:18
收藏:0
阅读:299
<script language="javascript">
if(!IsPC()){
window.location.href="/m/"; //要跳转的地址,也可以跳转到 window.location.href="http://m.xxx.com/";}
function IsPC()
{
var userAgentInfo = navigator.userAgent;
var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");
var flag = true;
for (var v = 0; v < Agents.length; v++) {
if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = false; break; }
}
return flag;
}
</script>
评论(0)