JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 11th, 2004, 01:24 AM
jayati jayati is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 6 jayati User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Determine whether 'onUnload' is triggerred by Refresh event or close browser event

The onUnload event is triggerred both when a user clicks the 'Refresh' button as well as when the user clicks the 'X' (close browser)icon on the browser.

Is there a way, I can stop the 'onUnload' event being called when the 'Refresh' button is clicked . Or is there a way, I can determine whether the user has clicked the 'Refesh' button or the 'X' icon?

Reply With Quote
  #2  
Old August 11th, 2004, 07:58 AM
dhouston's Avatar
dhouston dhouston is offline
Contributing User
Dev Articles Beginner (1000 - 1499 posts)
 
Join Date: May 2003
Location: Tennessee
Posts: 1,355 dhouston User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to dhouston
To my knowledge, there's no way to do this except perhaps for setting a cookie on the first page load. Then, for each time the page loads, if the cookie exists, suppress some behavior. I'm not sure even this will work, though, since it's an unload handler and you do want it to run if the X is hit.
__________________
Please don't PM me asking for solutions outside the scope of a thread.
Keeping all responses in a thread stands to help others who come along later,
which is after all what this forum's all about.

Reply With Quote
  #3  
Old July 7th, 2005, 03:08 AM
jebi123 jebi123 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 1 jebi123 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 20 sec
Reputation Power: 0
With IE you can use event.clientY<0 to know if the event came from the client area or from other part of the window (toolbar or x button)

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Determine whether 'onUnload' is triggerred by Refresh event or close browser event


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT