Is there a way to make sure a popup window stays behind the parent window until the page in the popup window is fully loaded?
Second, and somewhat related, what is the most reliable way to close a popup? I had tried this:
if(windowname && !windowname.closed) {
windowname.close()
}
However, it did not work on popups created by the following script:
[CODE]function popPDF(pdf) {
var leftPos = screen.width – 720;
var htm = “<html><head><title>Reference</title>”;
htm += “</head><body style=’padding:0;margin:0′>”;
htm += “<iframe src='” + pdf +”‘ width=’100%’ height=’100%’></iframe>”;
htm += “</body></html>”;
var ref = window.open(“”,”ref”,”menubar=1,resizable=1,scrollbars=1,status=1,height=400,width=710,left=”+leftPos+”,top=0″);
ref.document.write(htm);
ref.close;
ref.focus();
}
So, I tried this one:
window.open(”,’ref’).close();
This worked, but it causes a lot of flicker, which is the reason for question 1.