admin管理员组文章数量:1429491
This happens in IE6 when the user opens a popup window that opens a PDF inside. (this part works).
Then, the user opens another popup window, and at this point i get this error.
There is a good description and a possible solution here
my question is this:
Is there a better solution? Opening up a window and closing it right away seems like a silly solution to me.
This happens in IE6 when the user opens a popup window that opens a PDF inside. (this part works).
Then, the user opens another popup window, and at this point i get this error.
There is a good description and a possible solution here
my question is this:
Is there a better solution? Opening up a window and closing it right away seems like a silly solution to me.
Share Improve this question asked Jun 12, 2009 at 16:14 mkoryakmkoryak 58k64 gold badges203 silver badges262 bronze badges2 Answers
Reset to default 4I think I've got a better solution that doesn't involve closing the window first. The issue is that IE won't override a window (PDF or otherwise) if you attempt to open it again with an empty URL (i.e., ''). It will override a PDF with a non-empty URL, however. That could be a file, but about:blank works even better (which is what an empty URL does normally).
Depending on how your code is written, you may still want the try/catch, but this should eliminate the need:
windowHandle = window.open('about:blank',name,attributes);
windowHandle.document.location.href = url;
windowHandle.focus();
about:blank will force the PDF out of the child window and allow you to do what you need to do. It might not be a bad idea to place the setting of the URL and focus() in a windowHandle.onload() handler, so there aren't any timing issues with disposing of the PDF. I.e.:
windowHandle.onload=function(){
windowHandle.document.location.href = url;
windowHandle.focus();
};
I solved the problem using a try catch block.
windowHandle = window.open('',name,attributes);
try {
windowHandle.document.location.href = url;
} catch (exc) {
windowHandle.close();
windowHandle = window.open('',name,attributes);
windowHandle.document.location.href = url + suffix;
}
windowHandle.focus();
Seems to work for me.
本文标签: javascriptopening a popup in IEquotMember not foundquotStack Overflow
版权声明:本文标题:javascript - opening a popup in IE - "Member not found" - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745490652a2660589.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论