Gli ultimi tutorial di sviluppo web
 

Window opener Property

<Window Object

Esempio

Scrivere un testo alla sorgente (parent) finestra:

// Open a new window
var myWindow = window.open("", "myWindow", "width=200, height=100");

// Write some text in the new window
myWindow.document.write("<p>This is 'myWindow'</p>");     

// Write some text in the window that created the new window            
myWindow.opener.document.write("<p>This is the source window!</p>"); 
Prova tu stesso "

Definizione e l'utilizzo

La proprietà opener restituisce un riferimento alla finestra che ha creato la finestra.

Quando si apre una finestra con la finestra. open() metodo, è possibile utilizzare questa proprietà dalla finestra di destinazione per restituire i dettagli della sorgente (parent) finestra.

Coding Tip: window.opener. close() window.opener. close() si chiuderà la fonte (parent) finestra.


Supporto browser

Proprietà
opener

Sintassi

window.opener

Dettagli tecnici

Valore di ritorno: Un riferimento alla finestra che ha creato la finestra

<Window Object