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

Close Window Script

P: n/a
Hello there,

I need a "Close Window" script ( onLoad.Close.Window() ), however i need the
script so it don't come up with this annoying window:

"This window is trying to close" window.

Is there a script to stop this happening and close the window anyway?

Simon Fletcher
-------!-------
Jul 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
DU
Simon Fletcher wrote:
Hello there,

I need a "Close Window" script ( onLoad.Close.Window() ), however i need the
script so it don't come up with this annoying window:

"This window is trying to close" window.

Is there a script to stop this happening and close the window anyway?

Simon Fletcher
-------!-------


A window opened by javascript can be closed by javascript. A window not
opened with javascript can not be closed with javascript.
A window opened by the user himself can only be closed by the user himself.

http://jibbering.com/faq/#FAQ4_14

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/

Jul 20 '05 #2

P: n/a
DU
HikksNotAtHome wrote:
In article <bf**********@news.eusc.inter.net>, DU <dr*******@hotREMOVEmail.com>
writes:

Simon Fletcher wrote:

Hello there,

I need a "Close Window" script ( onLoad.Close.Window() ), however i need
the
script so it don't come up with this annoying window:

"This window is trying to close" window.

Is there a script to stop this happening and close the window anyway?

Simon Fletcher
-------!-------


A window opened by javascript can be closed by javascript.
A window not opened with javascript can not be closed with javascript.
A window opened by the user himself can only be closed by the user himself.

Try this in your browser:


Huh... I use up to 7 different browsers. :) So, which one?
<script type="text/javascript">
window.opener = window;
window.close();
</script>

I'll try it. I think Peter-Paul Koch already mentioned this hack at his
site.

http://www.xs4all.nl/~ppk/js/croswin.html#closingopener
In a test page. IE4/5.0, it still prompts, no other browser that I have that I
can test it on does it prompt. NN4.80? No prompt. Closes the browser.

http://jibbering.com/faq/#FAQ4_14

The FAQ is wrong in this regard.


Ok then. How about:

A window not opened with javascript should not be closed with javascript.
A window opened by the user himself should only be closed by the user
himself.

DU
--
Javascript and Browser bugs:
http://www10.brinkster.com/doctorunclear/

Jul 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.