简体   繁体   English

d3是未定义的错误

[英]d3 is undefined error

This is really driving me crazy. 这真的让我发疯。
http://www.myethiopia.org/QuickLinks/Stuff/Data/amtigray.html this works in firefox and chrome. http://www.myethiopia.org/QuickLinks/Stuff/Data/amtigray.html可以在Firefox和Chrome中使用。 I am getting the following errors in IE9. 我在IE9中收到以下错误。 1. HTML1204: myethiopia.org is running in Compatibility View because 'Display all websites in Compatibility View' is checked. 1. HTML1204:myethiopia.org在兼容性视图中运行,因为选中了“在兼容性视图中显示所有网站”。 2. SCRIPT5007: Unable to get value of the property 'prototype': object is null or undefined 3. SCRIPT5009: 'd3' is undefined 2. SCRIPT5007:无法获取属性'prototype'的值:对象为null或未定义3. SCRIPT5009:'d3'未定义

I had the same problem. 我有同样的问题。 There's a similar question on StackOverflow over here that had the answer for me. 在这里的StackOverflow上也有类似的问题,对我来说有答案。

Long story, short, be sure to include these two lines at the top of your HTML: 长话短说,请确保在HTML顶部包含以下两行:

<!DOCTYPE html>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />

That fixed it for me. 这为我解决了。 There are other suggestions at that link that might work for you, too. 该链接上还有其他建议可能也对您有用。 Good luck! 祝好运!

This is an issue in d3.v3.js well according to IE it is . 根据IE,这是d3.v3.js中的一个问题。 The offending line appears to be: 令人反感的行似乎是:

 d3_document.createElement("div").style.setProperty("opacity", 0, "");

You'll likely need to modify the d3 library in order to resolve this. 您可能需要修改d3库才能解决此问题。 There are some answers here that you should review. 有一些答案在这里 ,你应该检讨。

I appreciate this is not a complete answer however this is the reason for the error and hopefully will point you in the right direction. 我很欣赏这不是一个完整的答案,但这是错误的原因,希望可以为您指明正确的方向。

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

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