var clicked = false;
function CheckBrowser() {
// debugger;
if (clicked == false) {
//Browser closed
} else {
//redirected
clicked = false;
}
}
function bodyUnload() {
if (clicked == false)//browser is closed
{
var request = GetRequest();
// request.open("GET", "../../LogOut.aspx", true);
request.open("GET", "LogOut.aspx", true);
request.send();
}
}
function GetRequest() {
var xmlHttp = null;
try {
// Firefox, Opera 8.0+, Safari
xmlHttp = new XMLHttpRequest();
}
catch (e) {
//Internet Explorer
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
}
return xmlHttp;
}
这是我的javascript代码。
我希望在浏览器关闭时清除会话但它不起作用?
我在logout.aspx
上向此发送请求,但它不起作用。