Access denied using location.reload function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am having an interesting problem where I am simply trying to put in
country selection popup window on my site. When the user closes the window
the popup should call the window.opener.location.reload(true) function and
show the newly selected country. Well, when I try it from my MAC box I get an
Access denied error but when I do it from my IIS box it works.

Both environments are using the same exact function to open the popup. In
fact they are both opening the same popup on my IIS box. I can't seem to
figure out why this would be happening.

Here is my script for both the calling and popup pages.

//popup open function
function centerPopup(pageURL, winName, w, h, scrollYesNo) {
// new window utility
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
var winprops =
'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scrollYesNo+',resizable';
win = window.open(pageURL, winName, winprops);
if (win != null) {
if (win.opener == null) {
win.opener = self;
}
}
win.focus();
}

//calling pages both have this exact same link
<A CLASS="subnav"
ONCLICK="centerPopup(this.href, 'Country', '400', '300', 'no');return
false;"
HREF="http://test2.dharmacon.com/PopCountry.aspx">Change Country</A>

//and finally, the Refresh code from the popup
function RefreshParent(){
if (window.opener.location){
window.opener.location.reload(true);
//this is where the error occurs
}
self.close();
}

From my calling function I have been able to determine that the
opener.location is populating but for some reason when it comes from my MAC
box it's not accessible.

Is this by design? If so, how do I get around it?
 
the domain name (part of the url) between the opener and the pop must match.

-- bruce (sqlwork.com)
 
Back
Top