Opening popup in IE - "Member not found"

This happens in IE6 when the user opens a popup that opens the PDF inside. (this part works).

Then the user opens another popup, and at that moment I get this error.

There is a good description and a possible solution here

my question is this:

Is there a better solution? Opening a window and closing it immediately seems to me a stupid decision.

+3
source share
2 answers

, , . , IE (PDF ), URL- (.. ''). PDF URL-. , : blank ( URL-).

, , try/catch, :

windowHandle = window.open('about:blank',name,attributes);
windowHandle.document.location.href = url;
windowHandle.focus();

about: blank PDF , . , URL focus() windowHandle.onload(), PDF . :.

windowHandle.onload=function(){
    windowHandle.document.location.href = url;
    windowHandle.focus();
};
+4

, catch try.

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();

, .

+2

Source: https://habr.com/ru/post/1710356/


All Articles