| Author |
how to identify a window close and a window refresh event
|
Rohit Rai
Ranch Hand
Joined: Aug 04, 2008
Posts: 53
|
|
Hi!
I have been looking around but could not get any idea as to how to differentiate between a close event and refresh event using JavaScript. As the onUnload event is called both the time. i.e. if the user closes the window and also if he/she refreshes it.
Any idea as to how to go about?
Regards,
Rohit
|
 |
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15357
|
|
There is no way to do it. Eric
|
 |
Rohit Rai
Ranch Hand
Joined: Aug 04, 2008
Posts: 53
|
|
Hi Eric ! Yup I think so. Regards, Rohit
|
 |
suresh dasari
Ranch Hand
Joined: Oct 05, 2009
Posts: 120
|
|
Hey guys, I am trying to achieve the same thing, but couldnt do it.
any help is appricieated.
|
Sun Certified Java Programmer with 93 percent
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56233
|
|
|
As has already been said, it cannot be done. It doesn't matter how badly you need it.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
suresh dasari
Ranch Hand
Joined: Oct 05, 2009
Posts: 120
|
|
Hi guys,
I fount a partial solution.
I mean refresh can be done in 2 ways
1) clicking F5 button
2) browsers refresh button.
I found solution for F5 button.
but browsers refresh is pending.
any ways my requirement is only F5 because we is hiding the browser refresh button.
|
 |
Georgiana Lungu
Ranch Hand
Joined: May 17, 2010
Posts: 34
|
|
|
I have noticed that if a bean instantiated in the page we want to check for refresh, then, if a page is opened for unload, in that page request.getAttribute("bean_name"); returns null if browser with the first page was closed and returns not null if the browser was just refreshed. Please correct me if i am missing somethign.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56233
|
|
|
What do server-side beans have to do with JavaScript events?
|
 |
 |
|
|
subject: how to identify a window close and a window refresh event
|
|
|