window.onbeforeunload = function()
{
var n = window.event.screenX - window.screenLeft;
var b = n > document.documentElement.scrollWidth-20;
if(b && window.event.clientY < 0 || window.event.altKey)
window.location.href="<%=request.getContextPath()%>/webmaster/UserLogout.do";
}<body leftmargin="0" topmargin="1" Onunload="function()" >
恩,这是我页面的代码,,
我用的是jsp 当在地址栏输入 http://localhost:8080/aaaa/
进入到系统的时候我点击浏览器关闭按钮是可以响应这个事件的,
但是我一旦输入IP比如说我自己的ip http://192.168.0.100:8080/aaaa/
这样进入我的系统再点击浏览器关闭按钮它是不会响应这个事件的,
请各位大哥帮忙想个好点的方案。session就不用了,他麻烦,项目等着上线。。多谢之~
{
var n = window.event.screenX - window.screenLeft;
var b = n > document.documentElement.scrollWidth-20;
if(b && window.event.clientY < 0 || window.event.altKey)
window.location.href="<%=request.getContextPath()%>/webmaster/UserLogout.do";
}<body leftmargin="0" topmargin="1" Onunload="function()" >
恩,这是我页面的代码,,
我用的是jsp 当在地址栏输入 http://localhost:8080/aaaa/
进入到系统的时候我点击浏览器关闭按钮是可以响应这个事件的,
但是我一旦输入IP比如说我自己的ip http://192.168.0.100:8080/aaaa/
这样进入我的系统再点击浏览器关闭按钮它是不会响应这个事件的,
请各位大哥帮忙想个好点的方案。session就不用了,他麻烦,项目等着上线。。多谢之~
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货