JS判断微信ios或android不同终端并跳转到不同下载页面(一个网址实现多终端下载)

2016-10-28 11:33 来源: 未知
直接看代码 html格式 htmlheadmeta charset="utf-8"meta http-equiv="Pragma" content="no-cache"meta http-equiv="Cache-Control" content="no-cache"meta http-equiv="Expires" content="0"title二维码下载/title/headstyle type="text/css"bod
直接看代码 html格式
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Expires" content="0">	<title>二维码下载</title>
</head>
<style type="text/css">
body{padding: 0;font-size: 18px;text-align: center;}
</style>
<body>
<p>正在跳转下载.....</p>
<script type="text/javascript">
function iOS()
{
return /iPhone|iPad|iPod/i.test(navigator.userAgent)
}
		function isWeiXin()
			{
				var ua = window.navigator.userAgent.toLowerCase();
				if(ua.match(/MicroMessenger/i) == 'micromessenger'){
					return true
				}else{
					return false;
				}
			}
		if(isWeiXin()){
			    iOS()?window.location.href = "http://a.app.qq.com/qq市场" : window.location.href = "http://a.app.qq.com/qq市场";
			}else{
			    iOS()?window.location.href="https://itunes.apple.com/苹果商店":window.location.href="http://安卓本地下载地址.apk";
			}
</script>
</body>
</html>	
推荐内容