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 June 1st, 2007, 08:48 AM
srivalli srivalli is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2007
Posts: 1 srivalli User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 11 sec
Reputation Power: 0
Catch the event on closing window using mozilla browser

Hi

I tried the following code to catch the event on closing window.I am taking the unloadevent. But its not working in mozilla and working in IE browser.

function onBeforeUnloadAction()
{
var flag=window.confirm("You are closing the window. do you want to continue. Click 'Ok' to close or click 'Cancel' to stay back");

if(flag)
{
alert("bye");
}
else
{
// Stop the closing browser
//....
}
}
function fun()
{

if((window.event.clientX<0) || (window.event.clientY<0))
{
onBeforeUnloadAction();
}
Please give the solution to this one.

Reply With Quote
  #2  
Old June 2nd, 2007, 02:49 PM
Mittineague's Avatar
Mittineague Mittineague is offline
Contributing User
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jul 2005
Location: West Springfield, Massachusetts
Posts: 548 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 6 h 35 m 44 sec
Reputation Power: 4
on before unload

Hi srivalli, welcome to the forums,
Maybe change
Code:
if((window.event.clientX<0) || (window.event.clientY<0))
{
onBeforeUnloadAction();
}
to
Code:
window.onunload = onBeforeUnloadAction();

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Catch the event on closing window using mozilla browser


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 5 hosted by Hostway