更改URL而不刷新?

Spu*_*ter 2 html frameset

我在互联网上找到了一个应用程序,当你单击一个链接时,它将重定向到一个页面而不刷新整个地方并更改URL地址栏,我知道它可能因为JQuery可以访问客户端sode浏览器.

帮帮我.

Nic*_*nto 8

使用历史API你可以做这样的事情

  if (history && history.pushState){
     history.pushState(null, null, '/new/url');
  }
Run Code Online (Sandbox Code Playgroud)

现在使用chrome js控制台在浏览器中尝试它

这就是所需要的(可能多一点,但这就是它的基础

http://diveintohtml5.info/history.html中阅读更多内容