Javascript: Change Url without refreshing the page
This question already has an answer here:
In newer browsers that support history.pushState
you can replace the url without reloading.
Lets say a user browses to http://example.com/ernie.html
window.history.pushState({ foo: "bar" }, "page 2", "bert.html");
Will change the address bar to http://example.com/bert.html
, but won't cause the browser to load bert.html or even check that bert.html exists.
上一篇: 网站如何在网页更改中持续播放标题中的音频