问题
I need refresh in parent site / refresh my browser when I click testing. I have source index.php:
<iframe id="test" src="/careertest/q.php"></iframe>
and in q.php:
<a href="#" onclick="parent.location.reload(true);">testing</a>
Its working in FF LAtest version + Chrome but not working in IE 9.
He said "script70 :Permission denied."
I am already change
parent.location.reload(true)
with:
window.parent.location =window.parent.location.href;
or
document.domain=document.location.href;
but still not working...
回答1:
use this function
function reloadParentPage() {
var selfUrl = unescape(parent.window.location.pathname);
parent.location.reload(true);
parent.window.location.replace(selfUrl);
parent.window.location.href = selfUrl;
}
回答2:
Try adding "window" after parent.
parent.window.location.reload(true);
回答3:
This works in IE, Chrome and Firefox and may be others
window.top.location.reload();
来源:https://stackoverflow.com/questions/7545633/parent-location-reload-in-iframe-not-working-ie