473,385 Members | 1,531 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.

JavaScript & IE6: onbeforeUnload

Hi,

I am building a webbased application for the office, and have full control
over the webserver and the clientcomputers (with IE6).

I want to prevent that the employees use Alt-F4 to close IE6. I can do that
with the onbeforeUnload, but unfortunately I always get this messagebox:

Are you sure you want to navigate away from this page?
<my message>
Press OK to continue, or Cancel to stay on the current page.

Is there ANY way to get rid of this messagebox? I simply want "to stay on
the current page" without having to press Cancel. (The employees can leave
the application by pressing F12, that sets the variable
'booleanLeaveAllowed' to true, so they don't have to "press OK to continue"
to leave the application).
As I mentioned earlier, I have control over the client computers so if I can
do it by modifying the registry, no problem. The clients have OS Windows
Workstation 4.0.
Thanks,

Ray
P.S. Please Mr. Gates, get rid of the moron that keeps on putting
messageboxes in IE you can't disable!!!! The F3 key is also useless because
after setting NoFindFiles (employees are not allowed to browse) you keep on
getting a messagebox when pressing F3 without the means to disable it from
popping up!!!!
Jul 23 '05 #1
12 7018
rf
R. van Laake wrote:
I am building a webbased application for the office, and have full control
over the webserver and the clientcomputers (with IE6).

I want to prevent that the employees use Alt-F4 to close IE6. I can do that with the onbeforeUnload, but unfortunately I always get this messagebox:
Are you doing this to force your viewer to "log out"? If so then:

Do you also have control over the off switch on their computer?

Can you *ensure* that windows will never crash?

In both cases booleanLeaveAllowed will never be true;
The clients have OS Windows
Workstation 4.0.


That ancient?

--
Cheers
Richard.
Jul 23 '05 #2
On Mon, 8 Nov 2004 12:56:33 +0100, "R. van Laake"
<no***************@dfk.nl> wrote:
Is there ANY way to get rid of this messagebox? I simply want "to stay on
the current page" without having to press Cancel. (The employees can leave
the application by pressing F12, that sets the variable
'booleanLeaveAllowed' to true, so they don't have to "press OK to continue"
to leave the application).


Zeepe - http://www.meadroid.com/zeepe/ will let you achieve proper
controls of this sort of application.

Jim.
Jul 23 '05 #3
> Are you doing this to force your viewer to "log out"?
Yes. A number of tasks has to be performed like logging their log-off time,
showing the employee the planning, etc.
Do you also have control over the off switch on their computer? Of course not, what a stupid question. What are you implying, that I should
program nothing at all because the employees may turn off the computer,
either or not intentionally?
Can you *ensure* that windows will never crash? If I could I would and probably be a billionaire overnight.
The clients have OS Windows Workstation 4.0.

That ancient?

Yes, that ancient. I assume you think it would be much smarter to flush 300
NT licenses down the drain, buy 300 new XP licenses, and because of that buy
300 new computers becauze XP doesn't run that well on a Pentium I/II, and at
the end of the day realize that the tasks the computers are perfoming now
are EXACTLY the same was what they were doing before you spent all that
money. They only have to run IE6, nothing more, nothing less.
If all you can do is be a pisser please go to a toilet instead of a
newsgroup.


"rf" <rf@.invalid> wrote in message
news:tk******************@news-server.bigpond.net.au... R. van Laake wrote:
I am building a webbased application for the office, and have full control over the webserver and the clientcomputers (with IE6).

I want to prevent that the employees use Alt-F4 to close IE6. I can do

that
with the onbeforeUnload, but unfortunately I always get this messagebox:


Are you doing this to force your viewer to "log out"? If so then:

Do you also have control over the off switch on their computer?

Can you *ensure* that windows will never crash?

In both cases booleanLeaveAllowed will never be true;
The clients have OS Windows
Workstation 4.0.


That ancient?

--
Cheers
Richard.

Jul 23 '05 #4
rf
R. van Laake whined:
Are you doing this to force your viewer to "log out"? Yes. A number of tasks has to be performed like logging their log-off

time, showing the employee the planning, etc.
So. I actually have guessed what you are really trying to do. I assume their
log-off time is an important piece of data.
Do you also have control over the off switch on their computer?

Of course not, what a stupid question. What are you implying, that I

should program nothing at all because the employees may turn off the computer,
either or not intentionally?
The point of this question was to point out to you that you can not possibly
know in all instances when a user stops using your site. So, you will never,
in this instance, determine their log-off time.
Can you *ensure* that windows will never crash?

If I could I would and probably be a billionaire overnight.


The point of this question was to point out to you that you can not possibly
know in all instances when a user stops using your site. So, you will never,
in this instance, determine their log-off time.
The clients have OS Windows Workstation 4.0.

That ancient?

Yes, that ancient.


Sorry, that was meant to be tongue in cheek. :-)

I am aware that many people choose to stay with NT4 for whatever reason, and
rightly so.
If all you can do is be a pisser please go to a toilet instead of a
newsgroup.


So, you choose to call me a pisser for asking the obvious questions? The
questions you never even thought of?

What would happen when you present your boss with a solution that does not
take these quesions into account.

What happens when he simply turns his computer off and finds that he is
"logged-in" for the entire weekend?

What happens when he asks you "why?".

Would you call him a pisser?

You can *not* determine when a user has stopped using your site. You can
*ask* the user to tell you by using a log off link or something but you can
not *force* this. The very best you can do is something like a session
cookie that times out after, how long, lets pick 10 minutes. Of course then
when your user ducks out for a coffee a log off will occur.

--
Cheers
Richard.
Jul 23 '05 #5
On Mon, 8 Nov 2004 12:56:33 +0100, R. van Laake <no***************@dfk.nl>
wrote:

[snip]
I want to prevent that the employees use Alt-F4 to close IE6. I can do
that with the onbeforeUnload, but unfortunately I always get this
messagebox:

Are you sure you want to navigate away from this page?
<my message>
Press OK to continue, or Cancel to stay on the current page.

Is there ANY way to get rid of this messagebox?


No. It is a security measure. Even HTAs display the extra text.

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #6
Sorry that I let myself go in that way, but it seemed like the only reason
you answered my post was to be a smartass
So, you choose to call me a pisser for asking the obvious questions? The
questions you never even thought of?
I have been a programmer for this company for a very long time and know my
way around these problems. Yes, I have thought of these questions, in fact
many years ago. My previous DOS based app has worked well for years and
answered those questions well, and the webbased thing will do so too. I just
need to know more about the tricks behind webbased programming (most is
ready anyway).
You can *not* determine when a user has stopped using your site. You can
*ask* the user to tell you by using a log off link or something but you can not *force* this. The very best you can do is something like a session
cookie that times out after, how long, lets pick 10 minutes. Of course then when your user ducks out for a coffee a log off will occur.
About the session cookie: indeed, that's a way.
We "force" the employee to log out in an orderly manner by saying he won't
get paid if he doesn't do so... if his time isn't logged we can't bill the
clients, so no money comes in, so there's nothing to pay him with. Obviously
we're not that rigid, but the message does get across.
About the toilet: apart from that it is allowed, we also have a supervisor
to check that doesn't get out of hand.... can't expect to have the computer
do everything for oyu.
"rf" <rf@.invalid> wrote in message
news:12******************@news-server.bigpond.net.au... R. van Laake whined:
Are you doing this to force your viewer to "log out"? Yes. A number of tasks has to be performed like logging their log-off

time,
showing the employee the planning, etc.


So. I actually have guessed what you are really trying to do. I assume

their log-off time is an important piece of data.
Do you also have control over the off switch on their computer? Of course not, what a stupid question. What are you implying, that I

should
program nothing at all because the employees may turn off the computer,
either or not intentionally?


The point of this question was to point out to you that you can not

possibly know in all instances when a user stops using your site. So, you will never, in this instance, determine their log-off time.
Can you *ensure* that windows will never crash? If I could I would and probably be a billionaire overnight.


The point of this question was to point out to you that you can not

possibly know in all instances when a user stops using your site. So, you will never, in this instance, determine their log-off time.
> The clients have OS Windows Workstation 4.0.
That ancient? Yes, that ancient.


Sorry, that was meant to be tongue in cheek. :-)

I am aware that many people choose to stay with NT4 for whatever reason,

and rightly so.
If all you can do is be a pisser please go to a toilet instead of a
newsgroup.
So, you choose to call me a pisser for asking the obvious questions? The
questions you never even thought of?

What would happen when you present your boss with a solution that does not
take these quesions into account.

What happens when he simply turns his computer off and finds that he is
"logged-in" for the entire weekend?

What happens when he asks you "why?".

Would you call him a pisser?

You can *not* determine when a user has stopped using your site. You can
*ask* the user to tell you by using a log off link or something but you

can not *force* this. The very best you can do is something like a session
cookie that times out after, how long, lets pick 10 minutes. Of course then when your user ducks out for a coffee a log off will occur.

--
Cheers
Richard.

Jul 23 '05 #7
function CloseIT()
{
window.opener=null; window.close(); return false;
}

works fine for me!
-Aaron
Jul 23 '05 #8
"function CloseStageIT()"
"{"
"window.opener=null; window.close(); return false;"
"}"

This works just fine for me

Jul 23 '05 #9
hmmm I can't get the code to paste in the reply. It keeps closing my
window... hmmmm.

Jul 23 '05 #10
am9518 wrote:
function CloseIT()
{
window.opener=null; window.close(); return false;
}

works fine for me!


And where exactly did you test that code?

"works fine for me" doesn't make code that works in a cross-browser
environment.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #11
am9518 wrote:
hmmm I can't get the code to paste in the reply. It keeps closing my
window... hmmmm.


Then use a decent newsreader instead of a website to post from.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #12
I want to prevent that the employees use Alt-F4 to close IE6. I can do that with the onbeforeUnload, but unfortunately I always get this
messagebox:

Are you sure you want to navigate away from this page?
<my message>
Press OK to continue, or Cancel to stay on the current page.

Is there ANY way to get rid of this messagebox?
No. It is a security measure. Even HTAs display the extra text.

[snip] Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.


Thank you very much for giving the closest thing to an answer I've yet
come accross, this is VERY hard to find info on.

All I want to do is switch the priority of this window so cancel is the
default and buttonmashers don't accidentally leave the page.

after days of websearching and confirm windows with verbage like
"false" and "null" i'd like to give some ie programmers a peice of my
mind...

Jul 23 '05 #13

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

Similar topics

2
by: Mozzie ³ | last post by:
Can 'onbeforeunload' (ie) be used to trigger a javascript? I can't find any info on how or if this is possible. Regards.
2
by: M B HONG 20 | last post by:
Hi all - I am developing an ASP.NET (C#) application and need some help. I wish to call a server-side function (in the code-behind "file.aspx.cs") upon a user clicking on the "X" to close the...
8
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
4
by: sowencheung | last post by:
the bug of onbeforeunload is so obvious! in IE 6 it will popup twice "sometimes" I am using the following code window.onbeforeunload = null; window.onbeforeunload = confirmExit; var...
11
by: Nathan Sokalski | last post by:
I add several JavaScript events (onchange, onkeypress, etc.) to Controls using the Add method of the Attributes collection. However, if the JavaScript code contains certain characters, such as & or...
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...
8
by: ericgorr | last post by:
I have the following test page: http://ericgorr.net/test.html <html> <head><title>Simple JavaScript</title></head> <BODY ondragstart="alert(event.srcElement.tagName)"> <INPUT TYPE=text...
1
by: sreedhardasi | last post by:
Hi, I would like to call a javascript function when user clicks on browser's close button. Here is the scenario. 1. User clicks browser close button. 2. User will be displayed a popup or a...
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: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.