繁体   English   中英

history.pushstate在IE8中不起作用

[英]history.pushstate not working in IE8

我正在使用window.History.pushstate 在Chrome浏览器中工作正常,但在IE8中附加了路径#。 请帮忙。

以下是我的代码段:

  var History = window.History; 
  History.pushState(null, null, "/abc"); 

您写了window.History。 您是否包括Benjamin Lupton的history.js window.History和window.history与window.History指的是history.js,这使历史记录与html4浏览器向后兼容。

看一下这两个:

你可以参考下面的答案

IE历史记录推送状态

IE9及以下版本不支持pushState 调用以下行时会出现异常:

window.history.pushState(null, null, pathFullPage);

SCRIPT438: Object doesn't support property or method 'pushState' ?terms_and_conditions, line 62 character 21

您可能对查看此处讨论的一些变通办法感兴趣: IE中的Emulation / polyfill history.pushstate()

暂无
暂无

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

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