<script language=javascript>function window.onbeforeunload(){ if (typeof evt == 'undefined') { evt = window.event; }if (evt) { var n = window.event.screenX - window.screenLeft; var b = n > document.documentElement.scrollWidth-20; if(b && window.event.clientY < 0 || window.event.altKey){ // 這個(gè)可以排除刷新 關(guān)閉的時(shí)候觸發(fā) window.onunload = function() { window.location.href = "../logout.jsp"; } } }}</script>我試了試好像也是不行啊<script language=javascript>function window.onbeforeunload(){ if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey) { var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp.open("GET","logout.jsp",false); xmlhttp.send(); }}</script>
為什么關(guān)閉ie的時(shí)候有的時(shí)候能跳進(jìn)去logout.jsp有的時(shí)候不行?
ITMISS
2022-10-20 15:15:12