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 January 15th, 2007, 03:12 AM
sheelatt sheelatt is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 2 sheelatt User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 9 sec
Reputation Power: 0
How to handle the window closing event without calling windlow.onBeforeUnLoad()?

I want to validate something when the user clicks the X mark in the window to Close.I don't want to call the window.onBeforeUnLoad(),method ,since it is pop Up the confirmation Dialog Box.Since i don't want that Dialog box.

If any one suggests the alternative,it will be very much useful to me.

Thanks in advance.

Reply With Quote
  #2  
Old January 15th, 2007, 08:51 AM
colton22's Avatar
colton22 colton22 is offline
\ ^_^ / - Moderator
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2006
Location: near chicago, Illinois
Posts: 473 colton22 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 Days 1 h 19 m 14 sec
Reputation Power: 3
Send a message via AIM to colton22 Send a message via MSN to colton22 Send a message via Yahoo to colton22
how about onunload? or is that the same where you dont what it?

colton22
__________________


Hang Out, Listen To Music, Have Fun, and Customize Your Experiance All In One Place! - Colton22's World - This is My World

Reply With Quote
  #3  
Old January 17th, 2007, 02:54 AM
sheelatt sheelatt is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 2 sheelatt User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 25 m 9 sec
Reputation Power: 0
Quote:
Originally Posted by colton22
how about onunload? or is that the same where you dont what it?

colton22


If i calls the onUnLoad(),method it simply closing the window,then i showing the confirmation box(i have created for trail),but i wants to stop the window being closed till my validation gets over,
than i have to decide whether, the window has to close or not.
is it possible to stop the window to getts closed,without calling the onBeforeUnload()??????

Reply With Quote
  #4  
Old January 17th, 2007, 08:52 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
Javascript and DOM have limited control what a browser can do.
Refer to: HTML event types
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter!
DevArticles Forum Moderator

"The net is a waste of time, and that's exactly what's right about it." -- William Gibson

Reply With Quote
  #5  
Old March 1st, 2007, 08:25 AM
mailforhari mailforhari is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Mar 2007
Posts: 1 mailforhari User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 6 sec
Reputation Power: 0
Re: onbeforeunload

Quote:
Originally Posted by sheelatt
I want to validate something when the user clicks the X mark in the window to Close.I don't want to call the window.onBeforeUnLoad(),method ,since it is pop Up the confirmation Dialog Box.Since i don't want that Dialog box.

If any one suggests the alternative,it will be very much useful to me.

Thanks in advance.


---
You can very well use this onbeforeunload. If you dont want to see the dialog box, then only thing you have to do is... the function should not return any values to the 'onbeforeunload' event.

For ex: you should not write like this <body ... onbeforeunload="return yourfunction();"...>

instead it will work if you write <body... onbeforeunload="yourfunction();"...>


Try this and let me know if any issue araises...

Thanks

Hariprasad R
abouthtmls.com

Reply With Quote
  #6  
Old March 1st, 2007, 03:44 PM
Mittineague's Avatar
Mittineague Mittineague is offline
Contributing User
Click here for more information
 
Join Date: Jul 2005
Location: West Springfield, Massachusetts
Posts: 549 Mittineague User rank is Private First Class (20 - 50 Reputation Level)Mittineague User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 1 Week 1 Day 7 h 3 m
Reputation Power: 4
decision

Quote:
Originally Posted by sheelatt
i have to decide whether, the window has to close or not
You don't have to decide whether it closes or not. That decision belongs to the user. You can decide what happens before the window closes and what happens when the user closes the window, but not whether it closes or not.

Last edited by Mittineague : March 1st, 2007 at 03:57 PM.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > How to handle the window closing event without calling windlow.onBeforeUnLoad()?


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 3 hosted by Hostway
Stay green...Green IT