解决微信浏览器禁止链接跳转到iTunes
时间:2015-06-29 13:14:31
收藏:0
阅读:615
方法:微信页面通过safari浏览器打开 safari打开的时候进行跳转 <!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" /> <meta name="viewport" content="initial-scale=1.0, width=device-width" /> <title>引导页面</title> <link rel="stylesheet" href="__PUBLIC__/app_last/css/bootstrap.min.css" /> <script type="text/javascript"> function myBrowser(){ var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串 var isOpera = userAgent.indexOf("Opera") > -1; if (isOpera) { return "Opera" }; //判断是否Opera浏览器 if (userAgent.indexOf("Firefox") > -1) { return "FF"; } //判断是否Firefox浏览器 if (userAgent.indexOf("Chrome") > -1){ return "Chrome"; } if (userAgent.indexOf("Safari") > -1) { return "Safari"; } //判断是否Safari浏览器 if (userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1 && !isOpera) { return "IE"; }; //判断是否IE浏览器 } //以下是调用上面的函数 var mb = myBrowser(); if ("Safari" == mb) { //alert("我是 Safari"); self.location=‘https://itunes.apple.com/us/app/hao-shi-fu/id948551606?l=zh&ls=1&mt=8‘; } </script> </head> <style type="text/css"> .container{ padding-left:0px; padding-right:0px; width:100%; height:auto; } .container img{ width:100%; height:auto; } </style> <body> <div class="container"> <img src="__PUBLIC__/app_last/images/yindai.png" /> </div> </body> </html>
评论(0)