Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

window.opener problem

Status
Not open for further replies.

kurtmo5

Programmer
Jul 16, 2004
18
US
I am trying to update the parent window by closing the child window. It gives me a permission denied error when the button is clicked.


<script>
window.opener.location.reload();
window.opener.focus();
</script>
 
try removing:
window.opener.focus();

since the child is closed the focus will automatically go to parent window...

Known is handfull, Unknown is worldfull
 
An explanation for this is probably that when you

window.opener.location.reload();

...the connection between parent and child is broken. That is why focus cannot be sent.

However, focus will not automatically drop to the parent window if you close the child window if you clicked on some other window since the last time you clicked on the parent window.

If you want to make sure focus goes back, put the focus() command in first, then reload. Even though the focus is sent, the JavaScript will (should) run.

Hope that's helpful.

--Dave
 
window.opener.refresh();

i use that instead of reload, gets the same job done in this instance and doesn't break the relationship


[thumbsup2]DreX
aKa - Robert
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top