[Quote=引用 5 楼 zc19860213 的回复:]
//非法关闭调用的方法
function FF_Close() {
window.onbeforeunload = function() {
var n = window.event.screenX - window.screenLeft;
var b = n > document.documentElement.scrollWidth - 20;
if (b &……
[/Quote]
上面两个方法你都不满意的话,就用效率比较低的方法Ajax每隔一个时间段写入一下时间,这样就算是意外情况关闭也可以将时间误差减小到最小话,如果你设时间段为两秒,那么最多就两秒的误差
//非法关闭调用的方法
function FF_Close() {
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) {
//这里你要处理的代码
}
}
}