PDA

View Full Version : Having a problem with a New Window function


Grizz2
02-17-2003, 03:22 AM
Hi all,
This function works fine when used once but if you close the NewWindow and click the link again I get an error. The error is something like "The callee is not available and has disapeared"
If I refresh the page it works fine again, once.
Any thoughts are appreciated.

function newWindow(page,W,H){
var newPage = page;
var newW = W;
var newH = H;
var content;
content="";
content+="<html><head><title></title></head>";
content+="<body topmargin='0' marginheight='0' leftmargin='0' marginwidth='0'>";
content+="<img src=" + newPage + "></html>";
newWindow = open('', 'NewWindowA','resizable=no, scrollbars=no top=0,left=0,width=' + newW + ',height=' + newH + '');
newWindow.document.write(content);
newWindow.document.close();
}

Grizz2
02-17-2003, 03:27 AM
Sorry all,
I worked on this for a couple hours and as soon as I posted, Yep it hit me. I was naming my window with the function name...Duhh
Thanks anyhow.