I was using the following code to open the pdf files using popup.
User come to a page that has 2 links that open with the below function. both opens a pdf. If the user clicks the pdf link and then minimizes it and then clicks the other link the Member not found error generates.
WRONG
function popUp(strURL, strType, strWidth, strHeight, winName, leftPos, topPos) {
var strOptions="";
if (strType=="nocontrols") {
strOptions="scrollbars,resizable,height="+ strHeight+",width="+strWidth+",left="+leftPos+",top="+topPos;
}
if (strType=="controls") {
strOptions="toolbar,menubar,location,scrollbars,resizable,height="+strHeight+",width="+strWidth+",left="+leftPos+",top="+topPos;
}
var newWin = window.open(strURL, winName, strOptions);
newWin.focus()
}
The problem was when the window opens it lost is reference & parent window throws the error use the following modified code to resolve this issue.
RIGHT
var newWin;
function popUp(strURL, strType, strWidth, strHeight, winName, leftPos, topPos) {
var strOptions="";
if (strType=="nocontrols") {
strOptions="scrollbars,resizable,height="+ strHeight+",width="+strWidth+",left="+leftPos+",top="+topPos;
}
if (strType=="controls") {
strOptions="toolbar,menubar,location,scrollbars,resizable,height="+strHeight+",width="+strWidth+",left="+leftPos+",top="+topPos;
}
newWin = window.open("", winName, strOptions);
newWin.close();
newWin = window.open(strURL, winName, strOptions);
if (window.focus)
{
newWin.focus()
}
}
This works!!
Thanks a lot!!
This really works, even with IE 6
Thanks
Thank u very much. You solved my problem
This works great! Thanks
A small problem the window closes everytime and opens new window again. Is there any way to avoid that?
Thanks
Harry
thanks a ton. Really u saved my day