What is the name parameter in window.open ()

please someone tell me what is the name of the window in window.open() , is it the name of the name or some id in java script language?

+4
source share
3 answers
 windowName 

The name to be assigned to the new window. The name can be used to re-access this window.

After opening the window, you will want to do all kinds of things with it, for example. move it and then you can do

 <html> <head> <title>Window Example</title> </head> <SCRIPT language="JavaScript1.2"> function poponload() { testwindow= window.open ("", "mywindow"); alert('I will move window to 0,0'); testwindow.moveTo(0,0); } </SCRIPT> <body onload="javascript: poponload()"> <H1>Window Example</H1> </body> </html> 

AND NO , not the window title is different.

- a source

+4
source

From MDC on window.open ()

 window.open(strUrl, strWindowName [, strWindowFeatures]); 

strWindowName
This is a line that simply names a new window. Such a string can be used to be the target of links and forms when the target attribute of an element is <a> or a <form> . This string parameter must not contain any empty space. strWindowName does not specify the name of the new window.

+2
source

From the documentation :

zyate

 Optional. String that specifies the name of the window. This name is used as the value for the TARGET attribute on a form or an anchor element. _blank The sURL is loaded into a new, unnamed window. _media The url is loaded in the Media Bar in Microsoft Internet Explorer 6. Windows XP Service Pack 2 (SP2) and later. This feature is no longer supported. By default the url is loaded into a new browser window or tab. _parent The sURL is loaded into the current frame parent. If the frame has no parent, this value acts as the value _self. _search Disabled in Windows Internet Explorer 7, see Security and Compatibility in Internet Explorer 7 for details. Otherwise, the sURL is opened in the browser search pane in Internet Explorer 5 or later. _self The current document is replaced with the specified sURL. _top sURL replaces any framesets that may be loaded. If there are no framesets defined, this value acts as the value _self. 
+2
source

Source: https://habr.com/ru/post/1304017/


All Articles