469,356 Members | 1,999 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,356 developers. It's quick & easy.

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 6895
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by chrisdude911 | last post: by
4 posts views Thread by sowencheung | last post: by
1 post views Thread by David | last post: by
8 posts views Thread by ericgorr | last post: by
1 post views Thread by sreedhardasi | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.