前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >让app在微信和网页中都能下载

让app在微信和网页中都能下载

作者头像
战神伽罗
发布2019-07-24 15:51:20
7890
发布2019-07-24 15:51:20
举报
文章被收录于专栏:Eureka的技术时光轴
代码语言:javascript
复制
<%@ 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>
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档