eTianbun Posted June 15, 2012 Share Posted June 15, 2012 w3schools is realy missing the point about JS window.open(Name)' parameter. It should be a target name of the newly created window and not where the URI parameter should be opened. Link to comment Share on other sites More sharing options...
niche Posted June 15, 2012 Share Posted June 15, 2012 Please post the example you'd like to see included at http://www.w3schools.com/jsref/met_win_open.asp Link to comment Share on other sites More sharing options...
ShadowMage Posted June 15, 2012 Share Posted June 15, 2012 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 More sharing options...
justsomeguy Posted June 15, 2012 Share Posted June 15, 2012 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 More sharing options...
eTianbun Posted June 15, 2012 Author Share Posted June 15, 2012 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 More sharing options...
eTianbun Posted June 15, 2012 Author Share Posted June 15, 2012 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 More sharing options...
ShadowMage Posted June 15, 2012 Share Posted June 15, 2012 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 More sharing options...
eTianbun Posted June 15, 2012 Author Share Posted June 15, 2012 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. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.