我在路由器初始化后启动Backbone.history.start时遇到问题:

$(document).ready(function () {
    app = new StyleRouter();
    Backbone.history.start({pushState: true, root: '/'});
});


它在一开始就可以工作,但是后来我将HTML代码提供给另一个人进行重做(他不知道,他做了什么特别的事情),然后在Chrome中导致“ Uncaught Error:SecurityError:DOM Exception 18”,尤其是在线:

this.history.replaceState({}, document.title, this.root + this.fragment + loc.search);


在bone.js中。

深入研究并与较旧的代码进行比较无法获得任何结果。会是什么呢?

最佳答案

最后,我发现有一个js代码,在location.hash中添加了一个多余的斜杠。仍然好奇为什么它会导致安全错误。

07-24 19:12
查看更多