JavaScript Reference/Javascript Properties/opener — различия между версиями

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

Текущая версия на 08:22, 26 мая 2010

"opener" Example

    
<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>
<p style="text-decoration:underline; 
   cursor:hand;" 
   onClick="function1();">
   Click to open new window
</p>
</body>
</html>



"opener" is applied to

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



"opener" Syntax and Note

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