使用Javascript:刷新浏览器IFrame的具体 [英] Javascript: refresh IFrame browser specific

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

问题描述

我需要刷新它适用于​​不同的浏览器的iframe的解决方案。

可以确认,该code我发现在互联网上是正确的,或给我正确的JavaScript?

i need a solution for refreshing an iframe which works for different browsers.
can you confirm, that the code i found on the internet is correct or give me the correct javascript?

IE 7
   window.document.getElementById('iframeId')contentWindow.location.reload(真);

IE 8
   window.document.getElementById('iframeId')contentWindow.location.reload(真);

IE 9
   window.document.getElementById('iframeId')contentWindow.location.reload(真);

火狐12-17

   window.document.getElementById('iframeId')SRC = window.document.getElementById('iframeId')SRC;

浏览器< 19

  的document.getElementById('iframeId')contentWindow.location.reload();

Chrome < 19
document.getElementById('iframeId').contentWindow.location.reload();

现在的Chrome

???

Chrome now
???

Safari和Opera将是很好,但以上是很重要的。 iframe可能会在不同的领域。

Safari and Opera would be nice, but the above are important. the iframe may be in a different domain.

提前感谢!

推荐答案

在Chrome版本23.0.1271.97我使用只是试图

In Chrome version 23.0.1271.97 i just tried using

的document.getElementById('iframeId')。contentWindow.location.reload()

和它的作品。
你可以尝试:

and it works. You could try:

的document.getElementById('iframeId')。contentWindow.location.href =的document.getElementById('iframeId')。contentWindow.location.href

这篇关于使用Javascript:刷新浏览器IFrame的具体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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