Posted in Javascript onOctober 21, 2013
function setCookie(name,value,time){ var oDate = new Date(); oDate.setDate(oDate.getDate()+time); document.cookie = name+"="+value+";expires="+oDate; } function getCookie(name){ var arr = document.cookie.split("; "); for(var i=0; i<arr.length; i++){ var arr2 = arr[i].split("="); if(arr2[0] == name){ return arr2[1]; } } return ""; } function removeCookie(name){ setCookie(name,"",0) }
js中cookie的添加、取值、删除示例代码
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@