T
The Athiest
Hi,
I have the following JavaScript function which works fine in IE, Opera and
Firefox. I can't get it to work in Netscape 7.2
Here is the code:
/**************************************************/
/* Display a popup window centered on the screen. */
/* Width and Height are supplied by the caller. * /
/**************************************************/
var win= null;
function newWindow(mypage,myname,w,h,scroll) {
var winl = (screen.availWidth-w)/2;
var wint = (screen.availHeight-h)/2;
var settings ='height='+h+',';
settings +='width='+w+',';
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +='scrollbars='+scroll+',';
settings +='resizable=yes';
win=window.open(mypage,myname,settings);
if (parseInt(navigator.appVersion) >= 4) {
win.focus();
}
if (!win.opener) {
win.opener = self;
}
return win;
}
1. I get the following error when I click on a link which attempts to open
the window:
"win has no properties"
2. When I comment out the two if statements at the bottom of the function, I
do not get an error but nothing happens (no window).
Any ideas?
Thanks,
Don
I have the following JavaScript function which works fine in IE, Opera and
Firefox. I can't get it to work in Netscape 7.2
Here is the code:
/**************************************************/
/* Display a popup window centered on the screen. */
/* Width and Height are supplied by the caller. * /
/**************************************************/
var win= null;
function newWindow(mypage,myname,w,h,scroll) {
var winl = (screen.availWidth-w)/2;
var wint = (screen.availHeight-h)/2;
var settings ='height='+h+',';
settings +='width='+w+',';
settings +='top='+wint+',';
settings +='left='+winl+',';
settings +='scrollbars='+scroll+',';
settings +='resizable=yes';
win=window.open(mypage,myname,settings);
if (parseInt(navigator.appVersion) >= 4) {
win.focus();
}
if (!win.opener) {
win.opener = self;
}
return win;
}
1. I get the following error when I click on a link which attempts to open
the window:
"win has no properties"
2. When I comment out the two if statements at the bottom of the function, I
do not get an error but nothing happens (no window).
Any ideas?
Thanks,
Don