Jump to content

window.open(Name) parameter


eTianbun

Recommended Posts

Actually, as far as I can tell, providing a name for the window does absolutely nothing. You cannot access it by that name through any means that I know of.It does work, however, and is more useful to be able to specify where the window will open with _blank or _self.

Link to comment
Share on other sites

The main purpose of the name is that you can open several things in the same window. You can have an external window with a certain name, and every time you specify that name in window.open it will open the URL in the same window, or create it again if it was closed.

Link to comment
Share on other sites

Actually, as far as I can tell, providing a name for the window does absolutely nothing. You cannot access it by that name through any means that I know of.
You cant access it through any means? Have you tried targeting that same window with its name, via links (<a>)?
Link to comment
Share on other sites

The purpose of the name is that you can open several things in the same window. You can have an external window with a certain name, and every time you specify that name in window.open it will open the URL in the same window, or create it again if it was closed.
Thats true, if the window already exist, it opens the URI via that window (instead of creating a new one) and thats why the name parameter, serves as target name for that window.
Link to comment
Share on other sites

The main purpose of the name is that you can open several things in the same window. You can have an external window with a certain name, and every time you specify that name in window.open it will open the URL in the same window, or create it again if it was closed.
That makes sense. Essentially, window.open() mimics the behavior of clicking a link. Perhaps a more appropriate label for that attribute would be target instead of name. And an explanation that it is actually the target for the window, but that one can use custom named windows as a target.
You cant access it through any means? Have you tried targeting that same window with its name, via links (<a>)?
You mean something like this:
<a target='TestWindow' href='http://www.w3schools.com'>W3Schools</a>

That seems to work. At least in FF. Then again, the target attribute is deprecated...

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...