<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<h1>电脑端</h1>
<script>
function isMobile() {
if ((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)))
return true;
else
return false;
}
//地址自己修改成你的手机端地址
if (isMobile() !== false)
window.location.href = "http://www.baidu.com";
</script>
</body>
</html>
网友评论