opener property
[This documentation is preliminary and is subject to change.]
Sets or retrieves a reference to the window that created the current window.
Syntax
| JavaScript | |
|---|
Property values
Type: Variant
the window reference.
Remarks
The opener property is available only for frame and iframedocuments.
Build date: 3/8/2012
How to refresh base page after closing the popup window?
If we want to close popup window then we window.opener.close() method. it simply close the popup window and control came to base window. After closing the popup window if we want to refresh the base window (because data changes in base window) then which method is used? for that window.opener.close() method is not used.. Kindly provide the solution for this??
Waiting for reply..
Thanks,
Anand Varne.
avarne@saba.com
Waiting for reply..
Thanks,
Anand Varne.
avarne@saba.com
- 5/24/2011
- Anand Varne
window.opener - example (one that's not unecessarily confusing)
You can use window.open to open a new window. For example the following code opens a new window without toolbars, menubars, etc.
<script language="javascript" type="text/javascript">
function open_child()
{
/* this opens a new window without toolbars, menubars, etc. */
lovechild = window.open("file_you_want_to_open.html", "lovechild","height=679, width=1200,resizable=0,menubar=0,toolbar=0,location=0,directories=0,scrollbars=0,status=0")
}
</script>
</head>
<body onload="open_child()">
</body>
In the newly opened window, you can access the original window by using window.opener. For example the following code closes the original window that opened it.
file_you_want_to_open.html:
<script language="javascript" type="text/javascript">
function close_opener()
{
/* this closes the window that opened this one. */
window.opener.close();
}
</script>
</head>
<body onload="close_opener()">
</body>
- 8/26/2007
- ameade
- 8/12/2009
- Manish 3177