微信返回跳转到指定页面js

    $(function(){
        pushHistory();
        window.addEventListener("popstate",function(e){
            location.href='跳转的URL';
        });

        function pushHistory() { 
        var state = { 
            title: "title", 
            url: "#"
        }; 
        window.history.pushState(state, "title", "#"); 
    } 
    });

 

posted @ 2018-03-02 11:49  张小三、  阅读(4219)  评论(1编辑  收藏  举报