Can a parent focus/close a child window?

R

Randell D.

I have a parent window that calls window.open("myurl","mywindowname");

I would like to do the all (or some) of the following - can someone help?

From the parent, close the child and...
From the parent, focus the child...

Anybody help me?

Thanks,
 
R

Randy Webb

Randell said:
I have a parent window that calls window.open("myurl","mywindowname");

I would like to do the all (or some) of the following - can someone help?

From the parent, close the child and...
From the parent, focus the child...

mywindowname.close();
mywindowname.focus();
 
R

Randy Webb

Randell said:
I have a parent window that calls window.open("myurl","mywindowname");

I would like to do the all (or some) of the following - can someone help?

From the parent, close the child and...
From the parent, focus the child...

Anybody help me?

Thanks,


Disregard my last post.

var myWindowHandle = window.open('myURL','myWindowName');

myWindowHandle.focus();
myWindowHandle.close();

The myWindowName can be used with targets:

<a href="somewhere.html" target="myWindowName">Somewhere</a>
 
R

Randell D.

Randy Webb said:
Disregard my last post.

var myWindowHandle = window.open('myURL','myWindowName');

myWindowHandle.focus();
myWindowHandle.close();

The myWindowName can be used with targets:

<a href="somewhere.html" target="myWindowName">Somewhere</a>

Luvely Juvely... thanks for that
randelld
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top