popup window reload parent.window.opener caused permission denied error if opener window navigate to other page

Hi, I have following JS problem can't be fixed. Hope somebody can help me here.
I have a linke in window A, when click open a popup window B, there is close button in B, after user finish their work in B, they click "close" button, it should close popup and refresh the calling window A. See following code I did:

<a href="javascript:top.close();parent.window.opener.location.reload();"><img align="top" src="../../images/button_blue_close<%=session("version")%>.gif" valign="center" border="0"></a>

I used "parent.window.opener" here since window A is inside a frameset, there is a menu bar above A. If user navigate in calling window such as click menu in to change content from A to C. then popup B close button will give me "permission denied" error. If they keep A window not change, then everything works fine.  I know the error caused by" parent.window.opener.location.reload();" since the url already changed. But I have to refresh the calling window to show update information there and I can't control people don't do navigation in calling page. Is there any suggestion here?
cpainoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

nabsolCommented:
Hi

Hope that you can get some idea and this is what you want. Need anything else let me know.

<html>
<head>
<title>Form Example</title>
<script LANGUAGE="JavaScript" type="text/javascript">
var DispWin;
function display() {
  DispWin = window.open('','NewWin', 'toolbar=no,status=no,width=300,height=200')
  message = "<head><script language='JavaScript'>"
  message += "function a(){\n"
  message +=  "window.opener.document.form1.check.click();\n"
  message +=  "window.close();\n"
  message += "}\n"
  message += "<\/script></head> <body>"
  message += "<ul><li><b>NAME: </b>" + document.form1.yourname.value;
  message += "<li><b>ADDRESS: </b>" + document.form1.address.value;
  message += "<li><b>PHONE: </b>" + document.form1.phone.value + "</ul><br>";
  message += "<input type='button' value='Close' onclick='a()'></body>";
  DispWin.document.write(message);
}
function test()
{
  window.location.replace(unescape(window.location.pathname));
}
</script>
</head>
<body>
<h1>Form Example</h1>
<form name="form1">
<p><b>Name:</b> <input TYPE="TEXT" SIZE="20" NAME="yourname">
</p>
<p><b>Address:</b> <input TYPE="TEXT" SIZE="30" NAME="address">
</p>
<p><b>Phone: </b> <input TYPE="TEXT" SIZE="15" NAME="phone">
</p>
<p><a href="javascript:display()">GO</a></p>
<br>
<p><input TYPE="BUTTON" VALUE="check" name="check" onClick="test();" style="display:none"></p>
</form>
</body>
</html>
<html><scrip
<html></html>


By Nab
0
cpainoAuthor Commented:
Nab, Sorry I may not clear with my question. I tried yours, it doesn't solve my problem. My calling page is A which is in a frameset, it has a link to popup window B, when user close window B, it will refresh the window A. But window A may open popup B, then A switch to C inside frameset based on user click on the menu. now user try to close popup window B back to A, A is no more there. get permission denied error.
0
cpainoAuthor Commented:
I got a solution for my problem from my co-worker George. Following is his solution:
window A popup window B, in B, use "top.close();" to close B. In A, <body onfocus="self.location.reload();">
Then I don't need to worry about refresh of window A, whenever A is on focus, it will reload to show update data there. Is that a neat and simple one?!
0
GranModCommented:
PAQed with points refunded (200)

GranMod
Community Support Moderator
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.