标签: javascript events jquery
可能重复: Is there a way in javascript to detect if the unload event is caused via a refresh, the back button, or closing the browser?
大家好
我有以下代码集
$(window).unload( function() { test(); });
test()将在我关闭窗口时调用,如果我刷新窗口......如何识别它是refresh还是close事件。我只需要在关闭事件中致电test()。请帮帮我......
refresh
close
test()