62,243
社区成员




window.onbeforeunload = function() {
// TODO: 这里添加和服务器通信的代码
}
<HTML>
<HEAD>
<SCRIPT>
function closeIt()
{
return "Any string value here forces a dialog box to \
appear before closing the window.";
}
window.onbeforeunload=closeIt;
</SCRIPT>
</HEAD>
<BODY>
<a href="http://www.microsoft.com">Click here to navigate to
www.microsoft.com</a>
</BODY>
</HTML>