Jump to content

window.open(Name) parameter


eTianbun
 Share

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. Edited by CodeName
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

It works in opera (10), firefox, IE(8), etc. Yes, target is deprecated, what about the NEW! CSS 3 target property? It should be 'name' and not 'target', but since it can also be used to target, thats still ok tho.

Edited by CodeName
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...