微信自带返回按钮自定义事件
jQuery(document).ready(function () { if (window.history && window.history.pushState) { $(window).on('popstate', function () { /// 当点击浏览器的 后退和前进按钮 时才会被触发, window.location.href = 自定义url; window.history.pushState('forward', null, ''); window.history.forward(1); }); } window.history.pushState('forward', null, ''); //在IE中必须得有这两行 window.history.forward(1); });
相关推荐
-
某个时间周期的头天或尾天 javascript
2019-1-7
-
JS判断当前页面是在 QQ客户端/微信客户端/iOS浏览器/Android浏览器/PC客户端 javascript
2019-1-8
-
无缝轮播 javascript
2019-1-8
-
微信小程序wx.request的Promise封装 javascript
2019-1-8
-
404页面 结合了一个闯迷宫的小游戏 javascript
2019-1-8
-
验证码倒计时js javascript
2019-1-8
-
js正则匹配 javascript
2019-1-8
-
js时间格式化 javascript
2019-1-8
-
对象类型判断工具 javascript
2019-1-7
-
用JavaScript将数字转换为大写金额 javascript
2019-1-8