主题:微信浏览器怎样打开手机已安装的APP
近期项目有一个需求,就是需要在微信中打开手机APP的应该,使用微信菜单,或在回复窗口中应该不能实现。现在唯一的思路就是通过页面的方式打,查了一些资料后发觉可以通过app url schemes,在页面中打开。吭爹的就是在所有浏览器中都测试没有问题,就是微信内置的浏览器不行。具体与这个问题差不多http://www.oschina.net/question/148218_235790,不知道有没有大神遇到我同样的问题,希望能出手解决。具体代码以下:
<html>
<head>
<title>测试</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" />
<meta content="yes" name="apple-mobile-web-app-capable" />
<script src="../js/jquery-1.10.2.js"></script>
<script type="text/javascript" src="../js/jweixin-1.0.0.js"></script>
<script type="text/javascript">
function Applink() {
//var url = "taobao://m.taobao.com"; //淘宝
var url = "dianping://searchshoplist?categoryid=60"; //大众点评
window.location = url;
setTimeout(function () {
alert("打开超时...");
}, 500);
}
</script>
</head>
<body onload="InitPage();">
<form id="form2" runat="server">
<div class="container width80 pt20">
<div class="control-group" align="center">
<input id="ButtonOrder" type="button" value="打开淘宝" width="200px" class="btn-large bg_red white" onclick="Applink();" />
</div>
<div class="control-group" align="center" id="divMessage">
</div>
</div>
</form>
</body>
</html>
<html>
<head>
<title>测试</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" />
<meta content="yes" name="apple-mobile-web-app-capable" />
<script src="../js/jquery-1.10.2.js"></script>
<script type="text/javascript" src="../js/jweixin-1.0.0.js"></script>
<script type="text/javascript">
function Applink() {
//var url = "taobao://m.taobao.com"; //淘宝
var url = "dianping://searchshoplist?categoryid=60"; //大众点评
window.location = url;
setTimeout(function () {
alert("打开超时...");
}, 500);
}
</script>
</head>
<body onload="InitPage();">
<form id="form2" runat="server">
<div class="container width80 pt20">
<div class="control-group" align="center">
<input id="ButtonOrder" type="button" value="打开淘宝" width="200px" class="btn-large bg_red white" onclick="Applink();" />
</div>
<div class="control-group" align="center" id="divMessage">
</div>
</div>
</form>
</body>
</html>