js 监听手机返回键

    if(window.history && window.history.pushState) {
      $(window).on('popstate', function() {
          window.location = 'http://www.baidu.com'
          return false;
      });
      window.history.pushState({ 
        title: "title", 
        url: "#"
      }, null, '#');
    }
posted @ 2019-12-16 13:28  渡心°  阅读(244)  评论(0)    收藏  举报