刷新iframe [英] Refresh an iframe

查看:81
本文介绍了刷新iframe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何刷新iframe?
例如:

How to refresh an iframe? For example:

<iframe src="http://google.com"></iframe>

我点击此iframe中的视频,然后点击按钮刷新iframe和我希望在iframe刷新时,在视频页面上。

I click on "Videos" in this iframe ,then click on a button to refresh the iframe and I want when the iframe is refreshed ,to be on that "Videos" page.

推荐答案

您无法刷新内部文档由于单一来源政策。

You can't refresh the inner document in there due to the single origin policy.

您是否尝试更改iframe的 src 属性并添加随机GET字符串强制重新加载?

Have you tried changing the iframe's src property and adding a random GET string to force a reload?

这应该有效:

<iframe id="myiframe" src="http://google.com"></iframe>

document.getElementById("myiframe").src = "http://www.google.com?"+(+new Date());

这篇关于刷新iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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