【发布时间】:2013-10-08 06:13:27
【问题描述】:
我正在尝试使用 d3.v3.js、world-110m.json 和 topojson.v1.js 让地图在 IE9 中工作(我也在使用 jQuery 10.1,所以它也被加载了)。它在 FF 和 Chrome 中运行良好,但据我所知,IE 8 及更低版本没有原生 SVG 支持,因此如果没有解决方法就无法支持。
不幸的是,IE9 似乎也无法正常工作。 IE 9 控制台报错:
SCRIPT87:参数无效。 d3.v3.js,第 726 行字符 4
d3_selectionPrototype.insert = function(name, before) {
name = d3_selection_creator(name);
before = d3_selection_selector(before);
return this.select(function() {
return this.insertBefore(name.apply(this, arguments), before.apply(this, arguments));
});
};
第 726 行是“return this.insertBefore”等。任何想法发生了什么以及如何解决?
【问题讨论】:
-
FWIW:我发现这个错误是在 d3 版本中引入的。 3.2.3(现在是 3.3.6)。我就此事联系了 Mike Bostock。他对 d3.v3 进行了轻微编辑,消除了这个错误。第 777 行:返回 this.insertBefore(name.apply(this, arguments), before.apply(this, arguments) || null);
标签: javascript jquery internet-explorer svg d3.js