2010-06-07 4 views

Répondre

1

Oui, window.opener existe en tant que référence à la fenêtre qui a ouvert la fenêtre en cours. Il est pris en charge dans au moins Chrome, Firefox, IE et Opera.

https://developer.mozilla.org/en/DOM/window.opener
http://msdn.microsoft.com/en-us/library/ms534309(VS.85).aspx

Si vous cherchez à obtenir une référence à la fonction qui a créé la fenêtre, vous pouvez ajouter vous-même comme une propriété de la fenêtre:

var win = window.open("test.htm", "myWin"); 

// set a global var in the window to this function 
win.openerFunction = arguments.callee; 
Questions connexes