改换页面地址而不刷新 (Modify the URL without reloading the page,翻译和转载)

这玩意能在这些浏览器里面做到了!: Chrome, Safari, FF4+, and IE10Platform Preview4+!

更详细信息可以查看这个页面: Updating address bar with new URL without hash or reloading the page

例子:

现在你可以用 window.onpopstate 来监控前进、后退动作了:

想更加深度了解? 查看如何操纵浏览历史: this MDN article.

This can now be done in Chrome, Safari, FF4+, and IE10pp4+!

See this question’s answer for more info: Updating address bar with new URL without hash or reloading the page

Example:

You can then use window.onpopstate to detect the back/forward button navigation:


For a more in-depth look at manipulating browser history see this MDN article.

原页面:http://stackoverflow.com/questions/824349/modify-the-url-without-reloading-the-page

更多参考:

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注