使用History.js时,在IE中使用#连接的重复URL

时间:2014-01-21 23:29:41

标签: javascript history.js html4

尝试使用History.js插件来处理IE9及更低版本等html4浏览器中的动态网址。出于某种原因,IE中pushState函数的行为不是我所期望的。要复制该问题,如果您使用IE 8转到demo页面并单击“History.pushState(null,null,”?state = 4“)”按钮。该网址将变为http://browserstate.github.io/history.js/demo/index.html#index.html?state=4,这似乎会将新网址附加到旧网址的哈希标记。而在其他现代浏览器中,它只是http://browserstate.github.io/history.js/demo/index.html?state=4

我一直在搜索并找到一些类似的帖子,例如jquery plugin history.js not working properly in html4 browsersUsing history.pushstate in IE9Javascript- history.pushState() not workin in IE。然而,他们都没有给出适合我的解决方案。在我的真实世界项目中,基本URL也将拥有自己的变量。因此,额外的URL会破坏工作流程。我正在寻找一些方法来使html4浏览器像现代浏览器一样工作。任何见解都表示赞赏。谢谢!

0 个答案:

没有答案
相关问题