$(function() {
$(".insert").click(function() {
var shop = {
"img": $(this).attr("img"),
"name": $(this).attr("name"),
"price": $(this).attr("price"),
"det": $(this).attr("dt"),
};
SetCookies('AddShop', shop)
function SetCookies(CookieName, str) {
var arr = [];
arr.push(str);
var data = JSON.stringify(arr);
$.cookie(CookieName, data, {
path: '/',
});
}
});
});
多个页面执行这个js
怎么保存数组里面的数据,cookie 里面就只有一条数据