0

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;
                }
            }
        }
    }
}
trosendal
  • 1,225
  • 9
  • 14
  • 1
    IE does not support `fill` https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array#Browser_compatibility Rewrite the code without `fill` or find/make a polyfill – Dmitry Feb 05 '19 at 08:02
  • 3
    Possible duplicate of [Object doesn't support property or method 'fill'](https://stackoverflow.com/questions/37729002/object-doesnt-support-property-or-method-fill) – PSK Feb 05 '19 at 08:03

1 Answers1

0

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.

trosendal
  • 1,225
  • 9
  • 14
  • 1
    From your last post, I can see that the issue is solved and you had posted the link for your solution. It will be helpful to other community members in future, If you try to mark that answer as an accepted answer after 24 hrs when it will be available to mark. Thanks for your understanding. – Deepak-MSFT Feb 06 '19 at 06:01