I'm using this short snippet of code:
var d = itemID + "," + quantity;
var CookieData = $.cookie("storebasket");
if(CookieData == null || CookieData == "") {
$.cookie("storebasket", d, { path: '/', expires: 60 });
} else {
$.cookie("storebasket", CookieData + "|" + d, { path: '/', expires: 60 });
}
However the value ALWAYS becomes HTML encoded. For example:
5%2C1
Which when decoded with this tool is:
5,1
I've tried using unescape
but no luck:
$.cookie("storebasket", unescape(d), { path: '/', expires: 60 });
Any more ideas?
jquery.cookie is encoding the comma by default. To override this just do:
$.cookie.raw = true;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With