Jump to content

How to reload the parent frame


Rain Lover

Recommended Posts

Sample parent code:
<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Parent</title></head><body><iframe src="https://dl.dropboxusercontent.com/u/4017788/Labs/child.html" width="200" height="100"></iframe></body></html>
See it in action:
Sample child code:
<!DOCTYPE html><html><head><meta charset="UTF-8"><title>Child</title></head><body><button onclick="myFunction();">Try it!</button><script>function myFunction() {parent.location.reload();}</script></body></html>
I have tried many methods offered in similar questions to no avail, such as:
window.parent.location.reload();
top.location.reload();
etc.
What am I missing and what's the right approach?
Link to comment
Share on other sites

The two pages are on different domains. They are not allowed to interact with eachother.

 

Here's the message from the error console:

Error: Permission denied to access property 'reload'parent.location.reload();
Link to comment
Share on other sites

The two pages are on different domains. They are not allowed to interact with eachother.

 

Here's the message from the error console:

 

Yes, that seems to be the problem. Then I need to put my question this way: How to reload the parent frame that's located on a different frame?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...