var ClearSession = function(){ var currentUserNamesplit = Ext.getCmp('userlistP').title.split(":"); var currentUserName = currentUserNamesplit[1]; //alert(currentUserName); Ext.Ajax.request({ url:'SessionManagement.aspx', method:'POST', params:{currentUserName:currentUserName}, success:function(response,opts){ alert(currentUserName); }, failure:function(){alert(currentUserName);} }); } 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) { ClearSession(); alert(1);//弹出使窗口暂时停顿等待进入后台进行调试。 //Ext.Msg.confirm("关闭退出系统提示","您确定要退出系统吗?",function(){}); } }