日期:2014-05-16 浏览次数:20967 次
var xmlHttp = false; var td; var e; var url; function createXmlHttpRequest(){alert("1.1"); if(window.XMLHttpRequest){alert("1.1.1"); xmlHttp = new XMLHttpRequest();alert("1.1.2"); if(xmlHttp.overrideMimeType){alert("1.1.3"); xmlHttp.overrideMimeType(text/xml);alert("1.1.4"); }alert("1.1.5"); }else if(window.ActiveXObject){alert("1.2"); try{alert("1.2.1"); xmlHttp = new ActiveXObject("Msxml2.XMLHttp");alert("1.2.2"); }catch(e){alert("1.2.3"); try{alert("1.2.4"); xmlHttp = new ActiveXObject("Microsoft.XMLHttp");alert("1.2.5"); }catch(e){alert("1.2.6"); } } } if(!xmlHttp){alert("1.3"); alert(xmlHttp+"err");alert("1.3.1"); } } function checkuser(o,otd,ourl){ alert("1"); url = ourl;alert("2"); td = otd;alert("3"); createXmlHttpRequest();alert("4"); var url = o;alert("5"); xmlHttp.open("GET",url,true);alert("7"); xmlHttp.send(null);alert("8"); xmlHttp.onreadystateChange= checkrs;alert("6"); } function checkrs(){ alert("6.1"); if(xmlHttp.readyState == 4){alert("6.2"); if(xmlHttp.status == 200){alert("6.3"); var s = xmlHttp.responseText;alert("6.4"); } } }
<script type="text/javascript" src="javascript/del.js"></script> <script type="text/javascript"> function deld(){ alert("close"); } function fr(){ alert("fr"); checkuser('movie.do?method=delSession','0','1'); alert("delsession"); } </script> </head> <body onbeforeunload="fr();" onunload="deld();" >
public ActionForward delSession(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { System.out.println("11"); if(request.getSession(false).getAttribute("confirm")!=null){ System.out.println("12"); request.getSession().removeAttribute("confirm"); System.out.println("13"); }else{ System.out.println("21"); request.getSession().removeAttribute("palyId"); request.getSession().removeAttribute("target"); System.out.println("211"); } System.out.println("22"); ..... }