jQuery- iframe循环父母窗口中的所有divs?
我的网站正在使用一些IFRAME,当在一个IFRAME之一中单击一个特定的链接时,我需要在父页面中找到所有其他iFrame并刷新它们。
过去,我使用了以下内容,但这是在父母中运行的。
$('div[id^="site-"]').each(function(i, obj) {
location.reload();
})
显然,当它在iframe中运行时,这将无法正常工作,因为其他iframe在父母中。无论如何,是否可以找到父母中的每个DIV,其中有ID启动站点 -
并刷新它们?
谢谢
My site is using some iframes, when a specific link is clicked in one of the iframes I need to find all the other iframes in the parent page and refresh them.
In the past I've used the following, but that has been run in the parent.
$('div[id^="site-"]').each(function(i, obj) {
location.reload();
})
Obviously this won't work when it's running in the iframe as the other iframes are in the parent. Is there anyway to find each div in the parent with an ID starting site-
and refresh them ?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我使用以下内容在iframe中使用以下操作:
console.log中的每个条目是我需要的元素。
I've got this working using the following in the iframe:
Each entry in the console.log is the element I require.