By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,814 Members | 2,162 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,814 IT Pros & Developers. It's quick & easy.

Automatically close lauching page without IE promt

P: n/a
Hi,
my page contains an applet. When I click on a link on the page, the
applet will be launched.Now I need my page can be automatically closed
when I close my applet.I can call the script from my applet to do
this, but the poor thing is each time the script is called, IE will
prompt to ask "the page you are viewing try to close the window ..".
Is there any possible way for the browser not to prompt like that. I
only know that a closing a popup window will not askk anything, but I
don't know more than this. Any help is appreciated ;) !!!

Re: Automatically close lauching page without IE promt
From: kaeli
Date Posted: 12/4/2003 2:03:00 PM

In article <40**************************@posting.google.com >,
th**************@yahoo.com enlightened us with...
Hi,
my page contains an applet. When I click on a link on the page, the
applet will be launched.Now I need my page can be automatically closed
when I close my applet.I can call the script from my applet to do
this, but the poor thing is each time the script is called, IE will
prompt to ask "the page you are viewing try to close the window ..".
Is there any possible way for the browser not to prompt like that. I
only know that a closing a popup window will not askk anything, but I
don't know more than this. Any help is appreciated ;) !!!


No. If I navigate to your page, I'd be pretty pissed if you closed my
browser without asking.
This is why javascript (default security environment) can't do that.
There may be a workaround with security/trusted sites sort of thing, but
your average settings won't allow it, nor should they.

If this is for an intranet or CD application, use an HTA. You get much
more flexibility there.

--
--
~kaeli~
The secret of the universe is @*&^^^ NO CARRIER
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"Thang Nguyen" <th**************@yahoo.com> wrote in message
news:40**************************@posting.google.c om...
my page contains an applet. When I click on a link on the
page, the applet will be launched.Now I need my page can be
automatically closed when I close my applet.I can call the
script from my applet to do this, but the poor thing is each
time the script is called, IE will prompt to ask "the page
you are viewing try to close the window ..". Is there any
possible way for the browser not to prompt like that. I only
know that a closing a popup window will not askk anything,
but I don't know more than this. Any help is appreciated ;)!!!

<snip>

As someone navigates their browser around they accumulate information,
most notably a history list of where they have been. If you closed that
browser window you may distort that information. It is not your
information so you should not be allowed to destroy it, and so browsers
will not normally let you close a window from a script without prompting
the user, unless you opened it with a script. That is normal and
reasonable behaviour for a browser.

Some browsers are buggy and can be hacked so that a window can be closed
without a prompt, but not all and bugs get fixed, so this is just
something that you just should not attempt to do on the Internet.

Richard.
Jul 20 '05 #2

P: n/a
>Some browsers are buggy and can be hacked
so that a window can be closed without a prompt,
but not all and bugs get fixed, so this is just
something that you just should not attempt to
do on the Internet.


I only know of one browser (on a PC) that won't
allow me to close a window that script didn't
open. Even NN4.80 allows it. Only Mozilla and
derivatives prevent it (and not all of them). In tabbed
browsers and the likes, it closes the active tab/window
but not the browser itself.

I had the discussion with Jim a while back whether
its a bug or not (I concluded it is - but not a bug thats high
on the "to fix" list, although that conclusion was based on
Jims information - not mine) since it goes against the
prescribed behavior. But personally, I have a very
difficult time believing that something that has worked
in IE since 4.0 and in NN since 4.x series as a "bug".

<script type="text/javascript">
window.opener = window;
window.close;
</script>
--
Randy
Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.