identifying between refresh and close browser actions

M

Matt

When we refresh the page (F5, or icon in browser), it will first
trigger ONUNLOAD event and then trigger
ONLOAD event. When we close the browser (X on right top icon), it will
trigger ONUNLOAD event.

Now when ONUNLOAD event is triggered, there is no way to distinguish
between
refresh the page or close the browser.

Here's the code fragment. The logic in window_unload() only applies to
closing the browser, not refreshing the page.

<BODY ONUNLOAD="window_unload()">
function window_unload()
{//logic that only applies to close the browser, not refresh the page.
}

Anyone knows the workaround to the problem?

Please advise. Thanks!!
 
M

Mark Parnell

Anyone knows the workaround to the problem?

What makes you think anyone is more likely to reply to this today than
they were when you posted it yesterday?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top