写入

使用js写入读取cookie
IT技术笔记

使用js写入读取cookie

90 0

写入cookie:function setCookie(name,value){document.cookie=name+"="+value;}获取cookie:function getCookie(cname){var name = cname + "=";var ca = document.cookie.split(;);for(var i=0; i<ca.length; i++) {var c = ca[i].trim();if (c.inde…