重新加载/刷新 iframe 的最佳方法是什么? [英] What’s the best way to reload / refresh an iframe?
本文介绍了重新加载/刷新 iframe 的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用 JavaScript 重新加载 .到目前为止,我发现的最好方法是将 iframe 的
src
属性设置为自身,但这不是很干净.有什么想法吗?
I would like to reload an <iframe>
using JavaScript. The best way I found until now was set the iframe’s src
attribute to itself, but this isn’t very clean. Any ideas?
推荐答案
document.getElementById('some_frame_id').contentWindow.location.reload();
注意,在 Firefox 中,window.frames[]
不能按 id 索引,而是按名称或索引
be careful, in Firefox, window.frames[]
cannot be indexed by id, but by name or index
这篇关于重新加载/刷新 iframe 的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文