Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > how to detect the page has refreshed??

Reply
Thread Tools

how to detect the page has refreshed??

 
 
Matt
Guest
Posts: n/a
 
      07-21-2004
When the page is refresh, it will first call window_unload() and
then call window_load(). The problem is I window_unload() is
invoked when the user click close button, or right top icon close
button. I don't want refresh will call window_unload. Any ideas?
thanks!!

function window_load()
{//etc..
}

function window_unload()
{//etc..
}

<BODY ONLOAD="window_load()" ONUNLOAD="window_unload()">
 
Reply With Quote
 
 
 
 
Richard Cornford
Guest
Posts: n/a
 
      07-21-2004
Matt wrote:
> When the page is refresh, it will first call window_unload()
> and then call window_load(). The problem is I window_unload() is
> invoked when the user click close button, or right top icon
> close button. I don't want refresh will call window_unload. Any
> ideas? thanks!!

<snip>

You have neglected to say why you want to do this.

The unload event is called whenever a page is unloaded for any reason
(except on the browsers that do not bother to call it when the browser
is closed). The only way of attributing a reason for the unload is when
it is the direct result of an action initiated within the document
(navigation, form submission). However, there is an extensive list of
user actions that will result in a page unloading, including closing
down the browser and refreshing the page, and no way of knowing which of
them applies to any given unload.

Almost any design that called for an interest in the distinction between
refreshing a page and closing a browser window would be unsuitable for
use over HTTP (as it is a stateless protocol).

Richard.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How detect if page is requested from other page or a fresh request Ankur ASP .Net 1 07-01-2009 02:36 PM
Refreshing page 1 after page 2 has been called from page 1 patrice.fiset@gmail.com Javascript 2 06-20-2007 10:13 PM
how to detect the page has refreshed?? Matt HTML 4 07-22-2004 08:11 AM
How to detect the user has logged out? Showjumper ASP .Net 1 01-27-2004 06:30 PM



Advertisments