replaceState()vs pushState() [英] replaceState() vs pushState()
问题描述
我一直在阅读和寻找 replaceState()
& pushState的()
。
另请阅读Mozilla的 article ,并且此 有趣强> 测试,但我仍然不清楚差异。
任何人都要小心解释他们的不同之处?
replaceState()会改变浏览器中的网址(即按后面的按钮不会让你回来) I've been reading and searching for advantages / disadvantages between Any one care to explain in what they differ? 这篇关于replaceState()vs pushState()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
$ b preush preushState()将改变URL,并保持旧的一个在浏览器历史记录中(即按下后退按钮将带你回去)replaceState()
& pushState()
.
Read also Mozilla's article, and this interesting test but still is unclear to me the differences.replaceState()
will change the URL in the browser (ie. pressing the back button won't take you back)pushState()
will change the URL, and keep the old one in the browser history (ie. pressing the back button will take you back)