473,385 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Help on onbeforeunload event to alert on close of window(X)

RJN
Hi

I have a pop-up window which has a task menu on its left which are
nothing but links to different screens. This window also has a close
button. On click of close button I do some server side operation and the
window closes itself. Now the user can close the window by clicking on
X(Top right corner) or by pressing Alt+F4 window. I want to atleast
alert the user when he does these 2 things to inform he has not clicked
on the close button. I tried using onbeforeunload event. The problem
with this event is it gets fired whenever the user navigates to a
different url by using the task menu. Any help is highly appreciated as
it has become critical now.

Regards

RJN

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 18 '05 #1
1 2666
you are on the right track, there is no browser close event, only page
unload (which happens on a navigation or postback). all valid submits
(postbacks) should disable your unload event handler.

-- bruce (sqlwork.com)
"RJN" <rj*@yahoo.com> wrote in message
news:en*************@TK2MSFTNGP14.phx.gbl...
Hi

I have a pop-up window which has a task menu on its left which are
nothing but links to different screens. This window also has a close
button. On click of close button I do some server side operation and the
window closes itself. Now the user can close the window by clicking on
X(Top right corner) or by pressing Alt+F4 window. I want to atleast
alert the user when he does these 2 things to inform he has not clicked
on the close button. I tried using onbeforeunload event. The problem
with this event is it gets fired whenever the user navigates to a
different url by using the task menu. Any help is highly appreciated as
it has become critical now.

Regards

RJN

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Derek | last post by:
Hello: Can anybody tell me how to detect browser close event in Javascript and how to call a servlet on a Brower close? I tried some thing: <html> <SCRIPT LANGUAGE="JavaScript1.2"...
1
by: Richard \(MrBonus\) | last post by:
the code is taken from my asp.net page. (written in C#) Hi, im trying to make my page postback before the it unloads, i've tried a lot of stuff, and finally I made something that worked, the...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
5
by: lightzizo | last post by:
Hi All, I want to override the onbeforeunload event so that when the user clicks on the close button, at the right top of the screen, it only open an alert with OK button and don't close the...
3
by: sonali | last post by:
i want to dopstback should get called on brower's close button click also function closewindow() { if (window.dialogArguments) { // Calling the method (given as argument) to cause the...
5
by: allan.young | last post by:
Hi, When in gmail I'm composing a new email message and I bit the browser back button, I get a dialog that says "Your message has not been sent. Discard your message?" But if instead of...
1
Frinavale
by: Frinavale | last post by:
Introduction I've seen many questions asked about how to disable the browser's back button and in the past I've replied with "it's simply not possible". It's not a good idea to disable the back...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.