Window.closed
来源:互联网 发布:在淘宝上买手机靠谱吗 编辑:程序博客网 时间:2024/05/17 06:59
Summary
This read-only property indicates whether the referenced window is closed or not.
Syntax
isClosed = windowRef.closed;
isClosed
- A boolean. Possible Values:
true
: The window has been closed.false
: The window is open.
Examples
Change the URL of a window from a popup
The following example demonstrates how a popup window can change the URL of the window that opened it. Before attempting to change the URL, it checks that the current window has an opener using the window.opener property and that the opener isn't closed:
// Check that an opener exists and is not closedif (window.opener && !window.opener.closed) { window.opener.location.href = "http://www.mozilla.org";}
Note that popups can only access the window that opened them.
Refreshing a previously opened popup
In this example the function refreshPopupWindow()
calls the reload
method of the popup's location object to refresh its data. If the popup hasn't been opened yet or the user has closed it a new window is opened.
var popupWindow = null;function refreshPopupWindow() { if (popupWindow && !popupWindow.closed) { // popupWindow is open, refresh it popupWindow.location.reload(true); } else { // Open a new popup window popupWindow = window.open("popup.html","dataWindow"); }}
Specification
HTML5
See also
- MSDN: window.closed Property
0 0
- Window.closed
- window.closed 属性的一个bug
- Closed!
- Closed!
- NoSuchWindowException:Unable to find element (on closed window)/(with xpath)
- selenium错误“[error] modifyWindow: Window was closed!” 解决
- Appium 报错:org.openqa.selenium.NoSuchWindowException: no such window: target window already closed
- client backup was not attempted because backup window closed 错误解决一例
- [error] isNewPageLoaded found an old pageLoadError: Error: Current window or frame is closed!
- Closed Fences
- Filesystem closed
- Stream closed
- connection closed
- Window
- window
- window
- window
- window
- 流程图和序列图
- 一道微软笔试题
- spring,定时器代码
- Tabbar点击后如何回到初始页
- android大图片的处理 解决内存溢出 OutOfMemoryError
- Window.closed
- 读书记之《Unix&Linux大学教程》
- 一步一步学zedboard之十八加载根文件系统启动内核
- Android Camera
- 我是怎么学习编程的?
- Android横向滚动屏幕特效分析
- 关于myeclipse报堆内存溢出和永久内存溢出的问题
- 真机调试
- GitHub 优秀的 Android 开源项目