iframe中的parent.location.reload不能正常工作 [英] parent.location.reload in iframe not working IE

查看:1170
本文介绍了iframe中的parent.location.reload不能正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我点击测试时,我需要在父网站刷新/刷新我的浏览器。我有源index.php:

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>

和q.php:

<a href="#" onclick="parent.location.reload(true);">testing</a>

它在FF LAtest版本+ Chrome中工作,但在IE 9中无效。

Its working in FF LAtest version + Chrome but not working in IE 9.

他说script70:许可被拒绝。

He said "script70 :Permission denied."

我已经改变了

parent.location.reload(true)

window.parent.location =window.parent.location.href;

document.domain=document.location.href;

但仍无效......

but still not working...

推荐答案

使用此函数

function reloadParentPage() {
    var selfUrl = unescape(parent.window.location.pathname);
    parent.location.reload(true);

    parent.window.location.replace(selfUrl);

    parent.window.location.href = selfUrl;
}

这篇关于iframe中的parent.location.reload不能正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆