window.close()

O

Obscurr

hi,

I'm wondering how I can close a window that is not active at the
moment using javascript?
example : I have two Internet Explorer windows opened, and I want to
close the one I'm not currently using. Maybe some form of
window.close()?

obscurr
 
L

Lasse Reichstein Nielsen

I'm wondering how I can close a window that is not active at the
moment using javascript?
example : I have two Internet Explorer windows opened, and I want to
close the one I'm not currently using. Maybe some form of
window.close()?

You need a reference to the window object of the other window.

If you have opened it yourself, you should still have the reference
returned by window.open. If it was opened by some other page and was
given a name, then you can use window.open with the same name, to get
a new reference to the window.

If the window wasn't opened by Javascript, then you can't/shouldn't
close it.

/L
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,277
Latest member
VytoKetoReview

Latest Threads

Top