码迷,mamicode.com
首页 > 微信 > 详细

微信页面阻止android回退键退出

时间:2015-12-31 10:39:37      阅读:574      评论:0      收藏:0      [点我收藏+]

标签:

<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>

<html>
<meta charset="utf-8" />
<meta name="viewport"
	content="initial-scale=1, maximum-scale=1, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />

<head>
<script src="//cdn.bootcss.com/jquery/3.0.0-alpha1/jquery.js"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"
	type="text/javascript"></script>

</head>
<script type="text/javascript">

$(function(){
	 $(window).bind(‘hashchange‘,
			 function(e) {
		 $(‘#urldisplay‘).html(window.location.hash);
		 window.history.forward(1)
		 //alert(2);
	 });
	 
	 var urlindex=1;
	$(‘#btn_hash‘).on(‘click‘,function(){
		window.location.hash =‘#c_‘+ (++urlindex);
	});	 
	 
	$(‘#btn‘).on(‘click‘,function(){
		alert(1);
		  WeixinJSBridge.invoke(‘closeWindow‘, {},
                  function(res) {})
	});
});
</script>
<body>asdasdasd

<input id="btn" type="button" value="aaaa"/> 

<input id="btn_hash" type="button" value="hash"/> 
<div id="urldisplay"></div>
</body>
</html>


微信页面阻止android回退键退出

标签:

原文地址:http://blog.csdn.net/zhangjianying/article/details/50439888

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!