简体   繁体   English

IE9中的History.pushstate()无法正常工作

[英]History.pushstate() in IE9 not working correctly

I want to change the whole link of my browser without reloading the page. 我想在不重新加载页面的情况下更改浏览器的整个链接。

I tried to use 我尝试使用

window.history.pushState('Object', 'title', new_url);

It works in firefox, chrome, IE11 but I need this to work with IE9. 它可以在Firefox,Chrome,IE11中使用,但我需要在IE9中使用。

So, I tried with History.js like this: 因此,我尝试使用History.js这样:

History.pushState('Object', 'title', new_url) ;

but in IE9 the new page url is concatinated with the old one, but I want it to be totally replaced! 但是在IE9中,新的页面网址已与旧的网址相对应,但是我希望将其完全替换!

Try your new_url with an absolute path. 尝试使用绝对路径的new_url。 like /prodult/2/prod_new.html and note that pushState is not supported in IE9 类似于/prodult/2/prod_new.html ,请注意IE9不支持pushState

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

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