js 实现浏览器返回按钮返回页面并刷新页面 微信可用

监听浏览器返回按钮,监听到以后执行来源重载  微信可用
$(document).ready(function(e) {
        var counter = 0;
        if (window.history && window.history.pushState) {
            $(window).on('popstate', function () {
                // 获取来源跳转
                // location.href=document.referrer;
            });
        }
        window.history.pushState('forward', null, '#'); //在IE中必须得有这两行
        window.history.forward(1);
    });

猜你喜欢

转载自blog.csdn.net/sym134/article/details/80509438
今日推荐