Closed Thread Icon

Preserved Topic: window.close() Pages that link to <a href="https://ozoneasylum.com/backlink?for=18294" title="Pages that link to Preserved Topic: window.close()" rel="nofollow" >Preserved Topic: window.close()\

 
Author Thread
maninacan
Paranoid (IV) Inmate

From: Seattle, WA, USA
Insane since: Oct 2001

posted posted 05-09-2002 00:29

OK, so I want to close a window without the annoying thing coming up that says This page is trying to close the window do you want to let it. I know there must be a way, because when a person clicks a link that closes a window it closes without that message. So, anyone know how I'd do this without any user input like clicking a link.

kewl

Mad Scientist

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 05-09-2002 00:54

You can only close windows that you've opened yourself without that message appearing.

maninacan
Paranoid (IV) Inmate

From: Seattle, WA, USA
Insane since: Oct 2001

posted posted 05-09-2002 01:25

How would I close another window. I tried just doing:

window.open("2w.html","asdf");
window.close("asdf");

But it didn't work, it just tried to close the current window, not the one I opened. Anyone know what I'm doing wrong?


kewl

Mad Scientist

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 05-09-2002 01:48

window always refers to the current window. If you want to refer to another window, you have to get a reference to that window, like this:

otherwindow = window.open("2w.html","asdf");
otherwindow.close(); // takes no arguments

maninacan
Paranoid (IV) Inmate

From: Seattle, WA, USA
Insane since: Oct 2001

posted posted 05-09-2002 02:28

Thanks, I thought you used the title of the window as an argument, oh well. Thanks again, it's working fine now.

kewl

Mad Scientist

« BackwardsOnwards »

Show Forum Drop Down Menu