前面有window.onunload=writeCookie;
如何取消掉他?

解决方案 »

  1.   

    window.onunload='null';clearCookie();document.form.submit();function clearCookie(){
    document.cookie='';
    alert('clearcookie');
    }已经window.onunload='null'再clearCookie()了,为什么表单提交后cookie中设置的变量还在?已经没有写cookie的地方了啊
    提交后cookie还是一长串"name=XXX;address=xxx;。"
      

  2.   


    <IMG style="CURSOR: hand" onclick="if(checkDate()) {window.onunload=function(){};clearCookie();document.form.submit();}" src="files/button_dc1.gif" align=absBottom>没用啊,window.onunload=function(){};后还是会调用writeCookie()