473,387 Members | 1,891 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,387 software developers and data experts.

cancel the 'unload' action in 'onbeforeunload' event

What code can I put in the 'onbeforeunload' event to cancel the 'unload'
action (when user closes browser) and then present the user with an
alert saying that he/she must use the logout button.

Jul 23 '05 #1
6 15860
On Mon, 19 Jul 2004 10:13:43 -0400, Marcia Gulesian wrote:
What code can I put in the 'onbeforeunload' event to cancel the 'unload'
action (when user closes browser) and then present the user with an
alert saying that he/she must use the logout button.


....Bwa! Ha Haaaa Ha Haaa... good one!
What? ..You're *serious*?

What happens when the user presses these keys?
<http://www.physci.org/kbd.jsp?key=ctrl+alt+del>

[ The 'user must log out' is an FAQ across HTML,
Site-Design, Java, JS... groups. You cannot
*guarantee* a log-out. ]

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #2
According to dhtml books from o'reilly et al, , this can be done.

Marcia Gulesian wrote:
What code can I put in the 'onbeforeunload' event to cancel the 'unload'
action (when user closes browser) and then present the user with an
alert saying that he/she must use the logout button.


Jul 23 '05 #3
On Mon, 19 Jul 2004 10:40:08 -0400, Marcia Gulesian wrote:

(force log-out)
According to dhtml books from o'reilly et al, , this can be done.


...and do they mention exactly how, as opposed
to vaguely waving hands about and espousing how
it *should* be possible? You're the one with
the book Marcia, what does it say?

I would be especially interested to hear how
they propose preventing the user from disconnecting
the cable that connects them to the internet,
or turning the computer off at the wall.

OTOH, I thought the c.l.js FAQ might mention
something about it.. ahh yes,
<http://www.jibbering.com/faq/#FAQ4_29>
and.. back to where I started. 'No'.

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #4
In article <40**************@theworld.com>, mg@theworld.com enlightened
us with...
According to dhtml books from o'reilly et al, , this can be done.

Marcia Gulesian wrote:
What code can I put in the 'onbeforeunload' event to cancel the 'unload'
action (when user closes browser) and then present the user with an
alert saying that he/she must use the logout button.



Really?
Post the source that gave you the impression that it could be done
*reliably*.

There's a very big difference between "can be done" and "can be done
reliably".

I can do a lot of things that only work in IE6 with javascript enabled
on a windows box with low security settings. Those things are generally
used in an HTA and are useless for much else. This group assumes cross-
browser internet use unless otherwise specified.

--
--
~kaeli~
Murphy's Law #3020: Quality assurance doesn't.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 23 '05 #5


Marcia Gulesian wrote:
What code can I put in the 'onbeforeunload' event to cancel the 'unload'
action (when user closes browser) and then present the user with an
alert saying that he/she must use the logout button.


Well check the documentation, here it is:
http://msdn.microsoft.com/library/de...foreunload.asp

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 23 '05 #6
Thanks!

Martin Honnen wrote:
Marcia Gulesian wrote:
What code can I put in the 'onbeforeunload' event to cancel the 'unload'
action (when user closes browser) and then present the user with an
alert saying that he/she must use the logout button.


Well check the documentation, here it is:
http://msdn.microsoft.com/library/de...foreunload.asp

--

Martin Honnen
http://JavaScript.FAQTs.com/


Jul 23 '05 #7

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

Similar topics

1
by: Dalan | last post by:
Although I have used the code below to suppress the DoCmd cancel action message from appearing on lots of other actions such as preview and print, I have not been able to get to work on a...
7
by: MLH | last post by:
I tried the following code to prevent a checkbox from being updated (going from a value of Null to True, from True to False or from False to True). I was surprised it did not work. Can anyone...
6
by: Mike | last post by:
I have a web form in my application that will be used for both viewing and updating information. I have a requirement that if any data has been changed on the page and the user attempts to leave...
2
by: Michael SL | last post by:
When a client requests to leave a Web Page, I want the web page to check for a certain condition. If that condition is met, I want to prompt the user to make sure they want to leave The method I...
0
by: Joe E. | last post by:
I have a .ASPX page in an iFrame and when the SRC of the iFrame changes the page_unload event does not fire. In order to get this event to fire, I tried using the onbeforeunload event in the body...
1
by: David | last post by:
I am using a process to warn users when they leave a page that there have been changes made. I took the example directly from Microsoft example I found in searching for help on the event...
2
gregerly
by: gregerly | last post by:
I'm working on a corporate intranet site and am trying to create a page that will warn a user on window unload if they have not saved thier work. Basically I just select all inputs, and on change,...
3
by: nareshreddy | last post by:
Hi i am using the below code to close the window and i l get promt when click on 'X' button on ie browser with OK and Cancel buttons. if i click ok window will be closed, if i click cancel window...
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:
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.