讓app在微信和網頁中都能下載

<%@ Page Language="C#" ContentType="text/html" ResponseEncoding="gb2312" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />

</head>
<body>
<script>
function is_weixin(){
	var ua = navigator.userAgent.toLowerCase();
	if(ua.match(/MicroMessenger/i)=="micromessenger") {
		return true;
 	} else {
		return false;
	}
}
var wx=is_weixin();
if(wx){
document.write('<%
Response.Write("請用瀏覽器打開<br>"+HttpContext.Current.Request.Url);
//Response.Redirect("http://www.jieshanghui168.com/down/jieshanghui.apk")
%>');
}else{
self.location='http://www.jieshanghui168.com/down/jieshanghui.apk'; 
<%
//Response.Redirect("http://www.jieshanghui168.com/down/jieshanghui.apk")
%>
}
/*        var ua = navigator.userAgent.toLowerCase();//獲取判斷用的對象
        if (ua.match(/MicroMessenger/i) == "MicroMessenger") {
                //在微信中打開
document.write('<%
Response.Write("請用瀏覽器打開<br>"+HttpContext.Current.Request.Url);
//Response.Redirect("http://www.jieshanghui168.com/down/jieshanghui.apk")
%>');
        }
        if (ua.match(/WeiBo/i) == "weibo") {
                document.write('//在新浪微博客戶端打開');
        }
        if (ua.match(/QQ/i) == "qq") {
                document.write('//在QQ空間打開');
        }
        if (browser.versions.ios) {
               document.write(' //是否在IOS瀏覽器打開');
        } 
        if(browser.versions.android){
                document.write('//是否在安卓瀏覽器打開');
        }
} else {
        Document.Write('//不然就是PC瀏覽器打開');
}*/
</script>
</body>
</html>
相關文章
相關標籤/搜索