Monday, June 3, 2024
178
rated 0 times [  184] [ 6]  / answers: 1 / hits: 22524  / 15 Years ago, sat, june 6, 2009, 12:00:00

I have the follow scenario:



I click a link which:
opens a popup window called 'popup' which loads a pdf inside of it (in IE6).



without closing the popup, i click the link again, which should reopen the pdf inside the popup, but instead a javascript error in thrown:
member not found



the javascript function used to open the popup is:



function openWindow(url, name, props) {
var windowRef = window.open(url, name, props);
if (!windowRef.opener) {
windowRef.opener = self;
}
windowRef.focus(); //error at this line, windowRef must be null
return windowRef;
}


question:
how do i get around this, without opening a new popup window every time?


More From » internet-explorer-6

 Answers
9

this is the hack that works that everyone on the internets is using:



function openWindow(url, name, props) {
if(/*@cc_on!@*/false){ //do this only in IE
var windowRef = window.open(, name, props);
windowRef.close();
}
var windowRef = window.open(url, name, props);
if (!windowRef.opener) {
windowRef.opener = self;
}
windowRef.focus();
return windowRef;
}

[#99367] Wednesday, June 3, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ryleymarkelb

Total Points: 554
Total Questions: 106
Total Answers: 95

Location: Norway
Member since Mon, May 23, 2022
2 Years ago
;