简体   繁体   English

更改页面URL而无需刷新-是否有跨浏览器的解决方案?

[英]Change page URL without refreshing - is there a cross-browser solution?

I've searched on stackoverflow quite a bit for an answer to this question, but can't seem to find a satisfying one. 我已经在stackoverflow上搜索了很多有关此问题的答案,但似乎找不到令人满意的答案。 Using the window.history.pushState() and window.history.replaceState() methods seem to be fairly easy, but to my understanding, they can be used in Chrome, Safari, FF4+, and IE10pp4+. 使用window.history.pushState()和window.history.replaceState()方法似乎相当简单,但是据我所知,它们可以在Chrome,Safari,FF4 +和IE10pp4 +中使用。 Is there a way to obtain this effect in IE8+ and FF3+ instead of just FF4+, and IE10pp4+ (plus Chrome & Safari) ? 有没有办法在IE8 +和FF3 +中获得这种效果,而不仅仅是FF4 +和IE10pp4 +(以及Chrome和Safari)?

Without the session history management you can only change the location.hash reliably (no 100% guarantee). 如果没有会话历史记录管理 ,则只能可靠地更改location.hash (不保证100%)。

Anything else can't be done without the browser loading another page. 没有浏览器加载另一个页面,其他任何事情都无法完成。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM