Hi
I have an Intranet webpage starting with a mainpage from which the user
can open a new window using a link that is calling a function:
function openWindows(){
var left, top;
width = (window.screen.availWidth/2)+130;
width2 = (window.screen.availWidth/2)-130;
height = (window.screen.availheight);
var settings= 'toolbar=no,location=no,directories=no,'+
'status=yes,menubar=no,scrollbars=no,resizable=yes , top=0, left=0, height='+height+',width='+width;
bogf = window.open('Kontering.asp?ro=false','',settings);
var settings= 'toolbar=no,location=no,directories=no,'+
'status=no,menubar=no,scrollbars=no,resizable=yes, top=0, left='+width+', height='+height+',width='+width2;
bilag = window.open('EGViewer.asp? ','picture',settings);
}
One window contains data, and one contains a picture. The user can edit data and save them.
When saving I use a
window.opener.top.content.location.reload(true);
to refresh the main window. After that the user can close the data window
by clicking a button, and then I would like to close the picture window as well
as the data window.
I works fine if the main page has not been reloaded ( = data window not saved ) but if it has been reloaded, I get a javascript access denied trying to reach the picture window.
This happens in IE 6.
My function to close the picture window:
function ClosePicture(){
if(eval('window.opener. picture ')=='[object]'){ // this to avoid then 'access denied' error
window.opener. picture.close();
}
}
Does anyone have any ideas ?
And what about IE7 ?
Regards
Chrisser