判断手机操作系统

<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>

</head>
<body>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"></script> 
<script>
var openUrl = window.location.search;
console.log(openUrl)
var u = navigator.userAgent.toLowerCase();
console.log(u)
if (u.indexOf('mobile') > 0) {
if(!(u.indexOf('iphone') > -1)) {
//安卓下载
alert(openUrl)
}else{
//IOS下载
alert("苹果")
}
}



</script>


</body>
</html>

posted @ 2016-10-20 10:07  好好听我说  阅读(146)  评论(0编辑  收藏  举报