Cookie的封装之修改、获取、删除
1、增加/修改 1 function setCookie(name,value,iDay){ var newDate = new Date(); newDate.setDate(newDate.getDate()+iDay); // 中文编码 value = encodeURIComponent(value); [removed]=name+=+value+;expires=+newDate+;path=/; } 2 function setCookie(key,val,ops){ ops = ops || {};
用户评论