关闭页面询问用户
function close() //关闭页面时询问用户
{
var n = window.event.screenX - window.screenLeft;
var b = n > document.documentElement.scrollWidth-20;
if (b && window.event.clientY < 0 || window.event.altKey)
{
window.event.returnValue = "";
}
}
onbeforeunload="close();"//写在页面body的onbeforeunload事件中