开发者

parent.location.reload in iframe not working IE

开发者 https://www.devze.com 2023-04-07 16:01 出处:网络
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>

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

开发者_JAVA技巧
document.domain=document.location.href;

but still not working...


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;
}


Try adding "window" after parent.

parent.window.location.reload(true);


This works in IE, Chrome and Firefox and may be others

window.top.location.reload();
0

精彩评论

暂无评论...
验证码 换一张
取 消