js 判断当前的手机系统类型
作者:网络 发布时间: 2017-07-03 阅读:
<script language="javascript">
window.onload = function () {
alert("1");
var u = navigator.userAgent;
if (u.indexOf('Android') > -1 || u.indexOf('Linux') > -1) {//安卓手机
alert("安卓手机");
// window.location.href = "mobile/index.html";
} else if (u.indexOf('iPhone') > -1) {//苹果手机
// window.location.href = "mobile/index.html";
alert("苹果手机");
} else if (u.indexOf('Windows Phone') > -1) {//winphone手机
alert("winphone手机");
// window.location.href = "mobile/index.html";
}
}
</script>
文章地址:http://blog.yunzhancms.com/index.php?s=/Article/detail/id/276 欢迎转载,转载时请注明出处