1

我正在使用 History.js 试图解决 IE8 和 IE9 上 window.history.pushState 缺乏兼容性的问题。

我将所有 hack 的函数封装在一个 hacks.js 文件中,并制作了这个函数来解决 pushState 问题:

 window.history = {
    pushState: function(state, title, url){
      return History.pushState(state, title, url)
    }
 };

但是 IE8 触发一个 javascript 错误,告诉我 window.history(在字符 3 上)是一个未找到的成员。

这很令人困惑,因为其他 hack 功能可以正常工作:

  window.console = {log:function(){}};
4

0 回答 0