3.1 history跳转页面产生跨域问题

  <script>
   const state = {
      'page_id': 1,
      'user_id': 5
    }
    const title = ''
    const url = 'hello-world.html'

    history.pushState(state, title, url)
  </script>

ftp协议

http协议

通过pushState改变url不向后端发送请求(不触发onpopstate事件)

直接通过地址栏修改url向后端发送请求

原文地址:https://www.cnblogs.com/xjt31/p/14462958.html