Click here to Skip to main content
15,900,973 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have Window A that opens Window B that opens Window C. When Window C closes, I want it to refresh Window B. In Window C I have this:

JavaScript
<body   onunload="opener.location.href = opener.location.href;">


This refreshes Window B on my localhost. If I use the same thing on our developement webserver, it doesn't work. I get Permission Denied Error. I am guessing that it doesn't work because Window B is on a different domain then Window A and Window B. On my localhost all of the windows were local. Is tehre a way to get this to work?
Posted
Updated 17-Feb-11 14:11pm
v4
Comments
Abdul Quader Mamun 17-Feb-11 20:04pm    
Use pre tag.

1 solution

certain actions are blocked in cross domain. One way to overcome this is to write a function in your B then call it from C

function reload()
{
  //force refresh  
}


Then call that function

<body   onunload="opener.reload();">
 
Share this answer
 
Comments
flomm 18-Feb-11 11:15am    
I tried this and it doesn't work. :( I even tried this:
<body önunload="opener.location.href = 'url of Window B';">
it works on localhost opening window from another domain. But it doesn't work from domain1 to domain2.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900