<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<script type="text/javascript">
function checkMobile() {
var pda_user_agent_list = new Array("2.0 MMP", "240320", "AvantGo", "BlackBerry", "Blazer",
"Cellphone", "Danger", "DoCoMo", "Elaine/3.0", "EudoraWeb", "hiptop", "IEMobile", "KYOCERA/WX310K", "LG/U990",
"MIDP-2.0", "MMEF20", "MOT-V", "NetFront", "Newt", "Nintendo Wii", "Nitro", "Nokia",
"Opera Mini", "Opera Mobi",
"Palm", "Playstation Portable", "portalmmm", "Proxinet", "ProxiNet",
"SHARP-TQ-GX10", "Small", "SonyEricsson", "Symbian OS", "SymbianOS", "TS21i-10", "UP.Browser", "UP.Link",
"Windows CE", "WinWAP", "Android", "iPhone", "iPod", "iPad", "Windows Phone", "HTC"/*, "GTB"*/);
var pda_app_name_list = new Array("Microsoft Pocket Internet Explorer");
var user_agent = navigator.userAgent.toString();
for (var i = 0; i < pda_user_agent_list.length; i++) {
if (user_agent.indexOf(pda_user_agent_list[i]) >= 0) {
window.location.href = "http://www.mobile.com";
}
}
var appName = navigator.appName.toString();
for (var i = 0; i < pda_app_name_list.length; i++) {
if (user_agent.indexOf(pda_app_name_list[i]) >= 0) {
window.location.href = "http://www.mobile.com";
}
}
}
</script>
</head>
<body onload="checkMobile();">
</body>
</html>
JS 判断移动端设备类型 跳转到Wap网站
最新推荐文章于 2020-12-24 14:50:01 发布