madmurphy / cookies.js

Simple cookie framework with full Unicode support
GNU General Public License v3.0
265 stars 54 forks source link

The new "clear" function doesn't work in IE11. #13

Closed Serrin closed 6 years ago

Serrin commented 6 years ago

The new "clear" function doesn't work in IE11 and the loading of the library casues a JS error in the loading time.

Please check the compatibility of the for..of on this page: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of (ECMAScript 2015 (6th Edition, ECMA-262))

There is another way to do this:

  clear: function (sPath, sDomain) {
    var that = this;
    this.keys().forEach(function (sKey) { that.removeItem(sKey, sPath, sDomain); });
  } 

The forEach can be replaced with a simple for loop.

madmurphy commented 6 years ago

@Serrin Thank you! Fixed.

Serrin commented 6 years ago

@madmurphy Not at all!

Now working in IE11.