Closing a different window

C

Chris Hall

Hi,

I am using javascript and am trying to close another browser window from it.
The browser window I am trying to close is the window that opened the other
wondow.

I have tried using the following code but it does not seem to do anything .

window.opener.close();

any other ideas anyone.

Cheer

Chris
 
R

Randy Webb

Chris said:
Hi,

I am using javascript and am trying to close another browser window from it.
The browser window I am trying to close is the window that opened the other
wondow.

"I open a window and want to close the original" seems to be a better
explanation of your question.

I have tried using the following code but it does not seem to do anything .

window.opener.close();

Define "does not seem to do anything". It should raise a warning, throw
an error, something. Even in IE.
any other ideas anyone.

Yeah, but most of them are not fit to be posted to c.l.j.

Stop trying to close my window. Its MINE. Leave it alone.

And if you are testing in IE, yeah, I can close the window there.
 
K

kaeli

Hi,

I am using javascript and am trying to close another browser window from it.
The browser window I am trying to close is the window that opened the other
wondow.

I have tried using the following code but it does not seem to do anything .

window.opener.close();

any other ideas anyone.

I do hope this isn't for general internet use. Users of tabbed browsers will
hate you forever.

That said, from the opened window, do
self.opener.close();
(somewhere in the body after the page has finished loading for best results)

If that doesn't work, tell us what browser it doesn't work from and post
fully testable code. Also post an error messages you get, if any.

--
--
~kaeli~
The man who fell into an upholstery machine is fully
recovered.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace
 

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,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top