简体   繁体   中英

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:

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:

Getting error in IE11 for javascript array

and suspect something similar is going on but can't identify the problem.

A suggestion is to remove fill() from this code:

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.

I loaded the polyfill.js code and it is now working properly in IE11.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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