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(mypag e,myname,w,h,sc roll) {
var winl = (screen.availWi dth-w)/2;
var wint = (screen.availHe ight-h)/2;
var settings ='height='+h+', ';
settings +='width='+w+', ';
settings +='top='+wint+' ,';
settings +='left='+winl+ ',';
settings +='scrollbars=' +scroll+',';
settings +='resizable=ye s';
win=window.open (mypage,myname, settings);
if (parseInt(navig ator.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(mypag e,myname,w,h,sc roll) {
var winl = (screen.availWi dth-w)/2;
var wint = (screen.availHe ight-h)/2;
var settings ='height='+h+', ';
settings +='width='+w+', ';
settings +='top='+wint+' ,';
settings +='left='+winl+ ',';
settings +='scrollbars=' +scroll+',';
settings +='resizable=ye s';
win=window.open (mypage,myname, settings);
if (parseInt(navig ator.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
Comment