<IE8错误:'polygonOptions.fillColor'为null或不是对象

< IE8 error : 'polygonOptions.fillColor' is null or not an object

本文关键字:null 对象 polygonOptions lt IE8 错误 fillColor      更新时间:2023-12-14

我用一些数据和多边形创建了一个融合表。我正在使用谷歌地图API进行样式设计。这是该网站的链接。它在最新的浏览器和IE 9中都运行得很好,但在< 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

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

for (t in e)

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

使用

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

迭代数组的项