[英]Page working in Edge, Chrome and Firefox but not IE11
I have a page that apparently works nicely in Firefox, Chrome, Edge but not in IE11 which some of the target users require: 我有一个页面显然可以在Firefox,Chrome,Edge中很好地工作,但是在某些目标用户要求的IE11中却不能:
https://www.sva.se/Maps/kattsalmonella/map.html https://www.sva.se/Maps/kattsalmonella/map.html
I get the error "Object does not support this property or method" at line 323, I have read this post: 我在第323行收到错误“对象不支持此属性或方法”,我已经阅读了这篇文章:
Getting error in IE11 for javascript array 在IE11中获取JavaScript数组错误
and suspect something similar is going on but can't identify the problem. 并怀疑正在发生类似情况,但无法确定问题所在。
A suggestion is to remove fill()
from this code: 建议从以下代码中删除
fill()
:
function getZoomData(){
zoomTest= new Array(zoomKod.length).fill(0), zoomPos = new Array(zoomKod.length).fill(0), zoomNeg = new Array(zoomKod.length).fill(0);
for(i in data2.features)
{
var dateparts = data2.features[i].properties["date"].split('-');
var sampledate = new Date(dateparts[0], dateparts[1]-1);
if(sampledate.getTime() >= minRange && sampledate.getTime() <= maxRange ){
for(k in zoomKod){
if(zoomKod[k] == data2.features[i].properties["NUTS_ID"]){
zoomTest[k] += data2.features[i].properties["samples"];
zoomPos[k] +=data2.features[i].properties["pos"];
zoomNeg[k] +=data2.features[i].properties["neg"];
break;
}
}
}
}
}
The solution was in this answer: 解决方案是在此答案中:
Object doesn't support property or method 'fill' 对象不支持属性或方法“填充”
and @dmitry 's comment. 和@dmitry的评论。
I loaded the polyfill.js code and it is now working properly in IE11. 我加载了polyfill.js代码,现在它在IE11中可以正常工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.