JavaScript Reference/Javascript Properties/opener
Версия от 18:30, 25 мая 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