<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script>
var userAgentInfo = navigator.userAgent;
var Agents = new Array("Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod");
var flag = false;
var v=0
for ( v = 0; v < Agents.length; v++)
{
if (userAgentInfo.indexOf(Agents[v]) > 0) { flag = true; break; }
}
if(flag){
window.location='m.html'; //如果是移动设备访问,就跳转到魔客吧。请更改为你的网址。
}
</script>
</head>
<body>
<h1>当前是PC端</h1>
</body>
</html>
简单自动判断访问设备
最新推荐文章于 2024-07-08 18:29:48 发布