Reputation: 2654
I have the following piece of code and would like to know how to make it work.
that.clear = function() {
setCookie(cookieName, [].toJSON(), "/", document.domain, false,
cookieLifeHours);
that.renderPopup();
};
I have tried including jquery.json.js?ver=2.5.1
but it has not made any difference.
Upvotes: 0
Views: 1551
Reputation: 59232
Don't know what's toJSON
, but you can use the native implementation - JSON.stringify
JSON.stringify([]) // "[]"
But, don't know what you're trying to do by encoding an empty array as JSON.
Upvotes: 2