我使用這個代碼一小段:jQuery的停止HTML編碼餅乾
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 });
}
然而的值總是變得HTML編碼。例如:
5%2C1
哪個解碼with this tool當是:
$.cookie("storebasket", unescape(d), { path: '/', expires: 60 });
任何更多的想法:
5,1
我使用unescape
但沒有運氣試過嗎?
奇怪。 Unescape適合我:http://jsfiddle.net/9LdxL/ – 2012-04-17 17:25:06
@Jonny,小提琴的作品,但當我們嘗試並將其保存到Cookie中時,該值始終是HTML編碼的 – 2012-04-17 17:30:36