当窗口打开时,window.closed = true怎么样? [英] How can window.closed = true, when the window is open?
问题描述
我正在执行代码,并且我意识到我无法关闭窗口,因为DispHTMLWindow2对象close属性仍然为true。
if(winObject.closed!= true)
winObject.close();
问题是winObject.closed == true,窗口显然是打开的。
有什么想法可以解决这个问题?
谢谢,
Grae
更新:我意识到这个问题可能与嵌入式PDF有关。
它看起来好像acrobat reader会让你的pdf文件一直在你身上打开
http://acrobatusers.com/forum/javascript/closing-pdf-doc-javascript
我发现一个先前的帖子,它检查窗口是否为空,而不是检查是否关闭(如果窗口不是null,那么我们知道它是打开的)如何关闭内含pdf的浏览器不知道这是否有助于解决问题
其他我找到的解决方案是使用iframe,就像已经说过的那样。
http://bytes.com/topic/javascript/answers/148260-pdf-popup-close-button
I am stepping through code, and I realized I cannot close a window, because the DispHTMLWindow2 object close property is still to true.
if(winObject.closed != true)
winObject.close();
The problem is winObject.closed == true, and the window is clearly open.
Any ideas where I can look to figure this out?
Thanks, Grae
UPDATE: I realize this problem may have to do with an embedded PDF.
It seems as though acrobat reader is keeping the pdf file open on you
http://acrobatusers.com/forum/javascript/closing-pdf-doc-javascript
I found a previous post that checks to see if the window is null rather then checking to see if it is closed (if the window isnt null then we know it is open) how to close a browser having pdf inside it not sure if that will help your problem
The other solution i found was to use an iframe like already stated.
http://bytes.com/topic/javascript/answers/148260-pdf-popup-close-button
这篇关于当窗口打开时,window.closed = true怎么样?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!