【问题标题】:< IE8 error : 'polygonOptions.fillColor' is null or not an object< IE8 错误:'polygonOptions.fillColor' 为空或不是对象
【发布时间】:2013-12-16 09:12:52
【问题描述】:

我创建了一个包含一些数据和多边形的融合表。我正在使用 google Maps API 对其进行样式设置。这里是link to the website。它在最新的浏览器和 IE 9 中运行良好,但在 &lt; IE 8 中我收到此错误:

Webpage error details :

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E)

Message: 'polygonOptions.fillColor' is null or not an object

【问题讨论】:

  • 您希望我们检查一个缩小的脚本吗?贴一些可读的代码。
  • @Dr.Molle,对不起,我已经解压了 scipt。会不会有帮助?

标签: javascript google-maps google-maps-api-3 internet-explorer-8 google-fusion-tables


【解决方案1】:

您正在使用迭代对象属性的方法迭代数组:

for (t in e)

这将导致意外行为,因为这也可能返回内置属性的名称,例如数组方法的名称(对我来说,当 t 为“map”时 IE 停止)

使用

for (var t=0; t<e.length; ++t) 

遍历数组中的元素

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-05-27
    • 2012-10-13
    • 2013-08-30
    • 1970-01-01
    • 2011-05-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多