首页 > 微信 > 详细

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

时间:2015-12-31 10:36:39      阅读:260      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!