Permission denied when accessing function in parent window

J

johkar

My child window has this script. "temp" is simply the value of the
select list which I am passing onchange. I get a permission denied
error in IE when executing selectOption.

function selectOption(temp){
if(temp == ''){
alert('You have not made a selection. Please make a selection
to continue.');
return false;
}
else
{
opener.setValues(temp);
window.close();
}
}

I launched the window with the following script from the main window:

function newWindow(myurl,mywidth,myheight,resize) {
var myDate=new Date();
var myTime=myDate.getTime();
var URL=(myurl.indexOf('?') > -1)?myurl + '&time=' + myTime:myurl +
'?time=' + myTime;
var w=mywidth;
var h=myheight;
var winname='popWindow';
var winl = (screen.width - w) / 2, wint = (screen.height - h) / 2;
var
winresize=(resize=='resize')?'scrollbars=yes,resizable=yes':'scrollbars=no,resizable=no';
var winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl +
',toolbar=no,status=no,menubar=no,' + resize;
if(win==null || win.closed)//only launch window if it doesn't already
exist
win=window.open(URL, winname, winprops);
win.focus()
document.onclick=winfocus;//set method to bring window into focus
}
 
A

Amie

Last time I had a similiar issue was when the opener and popup scripts
were on different domain (even subdomain).
It could be that, or something else.. Just out of curiosity, what does
setValues function do on the opener script??
 
J

johkar

It is all the same domain...even the same application...which is why it
driving me crazy. Set values simply splits the value passed back and
assigns it to some form fields.
 
J

johkar

Found the issue, there was a linked JavaScript file in the main page
which was setting document.domain='SOMETHING'; If I added that to the
popup too, all is well.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,782
Messages
2,569,616
Members
45,297
Latest member
EngineerD

Latest Threads

Top