javascript控制cookies及在跳出本页给出提示,是否放弃操作!(4) str=name+"="+escape(value); if(hours) str+=";expires="+nextTime.toGMTString(); if(path) str+=";path="+path; if(domain) str+=";domain="+domain; if(secure) str+=";secure"; document.cookie=str; } this.GetValue=function(name){ var rs=new RegExp("(^)"+name+"=([^;]*)(;$)","gi").exec(document.cookie),tmp; if(tmp=rs) return unescape(tmp[2]); return null; } }var _c=new Cookie();_c.SetValue("list1","啊",1);_c.SetValue("list2","噢",1);alert(_c.GetValue("list2"))document.writeln(document.cookie);//--></script></body></html>