如何使用相同的ID刷新多个iframe
How can refresh multiple iframes using the same ID
如何使用相同的ID刷新多个iframe。代码示例:
<iframe id="x123"></iframe>
<iframe id="x123"></iframe>
<iframe id="x123"></iframe>
我测试
document.getElementById('x123').contentWindow.location.reload();
或
parent.document.getElementById('x123').contentWindow.location.reload();
第一个就在另一个上面,它不刷新。
谢谢:)
id
代表身份,技术上总是唯一的。你可能指的是"相同的类别",而不是"相同的id"。
将id
属性改为class
<iframe class="x123"></iframe>
<iframe class="x123"></iframe>
<iframe class="x123"></iframe>
使用jquery访问元素:
$('.x123')
查找contentWindow.location.reload()
对应的jquery代码
相关文章:
- 刷新 iframe 中的页面
- 刷新 iframe 而不重定向父页面
- 如何使用 javascript 自动刷新 iframe 如果 src = X
- Javascript href 刷新 iframe 不起作用
- 在方向更改时刷新 iframe 的内容
- 刷新 iframe 错误
- 对话框模式关闭时刷新Iframe
- 单击刷新iframe
- 用javascript在Div中包装内容,而不刷新iframe
- 刷新iframe而不闪烁
- 使用不同的域从内部刷新iframe
- 刷新iframe后,OnStateChange不工作
- 单击屏幕时刷新iframe
- 浏览器应该不断刷新iframe——不工作
- 如何在html中定期间隔后刷新iframe
- 如何在php页面中刷新iframe
- 如何自动刷新iframe
- 如何用加载图像显示刷新Iframe url
- 页面加载后刷新Iframe一次
- 如何刷新 IFrame 中的链接