<script>
; (function (e) {
e.ChangeStatus = ChangeStatus
function ChangeStatus(url) {
if (this instanceof ChangeStatus) {
}
else {
return new ChangeStatus(url);
}
this.url = url;
}
ChangeStatus.prototype.ajax = function () {
if (checkout) {
checkout();
}
var img = Image ? new Image() : document.createElement("img");
img.src = this.url;
}
}(window))
var url = "/SaveStatus?Status=10";
var change = new ChangeStatus(url);
var changeStatus = $.proxy(change.ajax, change);
window.onbeforeunload = function () {
changeStatus();
return "离开?"
};
if (window.addEventListener) {
window.addEventListener("beforeunload", changeStatus, false);
} else if (window.attachEvent) {
window.attachEvent("onbeforeunload", changeStatus);
} else {
window["onbeforeunload"] = changeStatus;
}
</script>
转载请注明:SuperIT » 关闭页面的时候发送请求