How can window.closed = true, when the window is open?

让人想犯罪 __ 提交于 2019-12-23 23:51:36

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/3728315/how-can-window-closed-true-when-the-window-is-open

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!