parent.location.reload in iframe not working IE

試著忘記壹切 提交于 2019-12-31 04:58:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!