Is that possible I can assign an window object variable to an already opened window

D

datactrl

Hi, all

Is that possible I can assign an window object variable to an already opened
window? With window.open(), we can get a window object from opened window.
If a window has already opened, is there any way I can attach that window
with an object variable in javascript? Because I want to communicate with
that window. Thank you in advance!

Jack
 
V

Vincent van Beveren

Windows opened on other screens are inaccessable.

You can regain control. Suppose I want to close a window that was opened
on another page, and I don't have the object reference, but I do have
the name of the window I can do the following:

myWin = window.open("","<<windowname here>>");
myWin.close();

However, if the window refers to another site/domain you have no rights
to modify/read the content. window.document is protected.

I hope it helps.
Vincent
 
D

datactrl

Hi, Vincent

Thanks a lot. What is the window name? Is it the text on window's title bar?

Jack
 
T

Thomas 'PointedEars' Lahn

datactrl said:
Thanks a lot. What is the window name? Is it the text on window's title
bar?

No, it is the internal name of the window, the value of the window.name
property in the DOM and the name you would use for the "target" attribute
if you wanted the referenced resource to be displayed in that window.
[Top post]

Please do not do that, see the FAQ.


PointedEars
 

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,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top