Forums
Home / Plugin: SlimStat Analytics / js-error in wp-slimstat.js:321
(@51nullacht)
5 years, 2 months ago
Hi,
in wp-slimstat.js:321 is written
if ( target_classes.filter( value => -1 !== do_not_track.indexOf( ...
This will cause a JS-Error in IE11.
With ... value >= -1 ... it’s correct.
... value >= -1 ...
Best wishes
(@coolmann)
Hi @51nullacht
thank you for pointing it out. The syntax we use is indeed correct, as the => operator assigns an unnamed function to the filter, as you can see in:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter
This is valid ECMAScript 6 syntax, however it looks like IE11 doesn’t accept it. A way to solve this issue is to turn that declaration into a separate named function:
https://alligator.io/js/filter-array-method/#targetText=filter()%20Array%20Method%20in%20JavaScript&targetText=The%20item%20argument%20is%20a,sent%20to%20the%20new%20array.
We will add a fix for this issue to our next release.
Best, Jason