'opener' Example : opener « Javascript Properties « JavaScript Reference

'opener' Example

    
<html>
<body>
<script language="JavaScript">
    var newWin
    function function1() {
         newWin = window.open("http://www.java2s.com", 
                              "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>

    
      
      








Related examples in the same category

1.'opener' Syntax and Note
2.'opener' is applied to