JavaScript Reference/Javascript Properties/opener

Материал из Web эксперт
Перейти к: навигация, поиск

"opener" Example

   <source lang="javascript">
   

<html> <body> <script language="JavaScript">

   var newWin
   function function1() {
        newWin = window.open("http://www.wbex.ru", 
                             "subwindow", 
                             "width=400,height=150, resizable, top=250") 
   } 
   function hi() {
       if (!newWin.closed) {
           alert("The subwindow is closed");
       }
   }

</script>

Click to open new window

</body> </html>


     </source>
   
  


"opener" is applied to

   <source lang="javascript">

+----------------+--------------------------------------------------------------+ | Applied_To |window | +----------------+--------------------------------------------------------------+

     </source>
   
  


"opener" Syntax and Note

   <source lang="javascript">

Note: Read and write property. Who is the opener.

Syntax: window.opener = value It is possible to use the following syntax to reach deeper into the heritage of the window: window.opener.opener... window.opener.document.getElementById("elementID").propertyName = value


     </source>