将iFrame定位到另一页内 [英] Targeting an iFrame inside another page

查看:70
本文介绍了将iFrame定位到另一页内的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何定位当前iframe中另一个页面中的iframe?

how do i target an iframe in another page from my current iframe?

例如.

第1页-> iFrame(我点击了第2页中指向iframe的链接)

Page1 -> iFrame (I click a link that would go to the iframe in page2)

第2页-> iFrame(查看第1页的iframe中的链接所产生的输出

Page2 -> iFrame (view the output made by the link in the iframe in page 1

推荐答案

窗口有一个 frames 数组,您需要访问它.

The window has a frames array, you need to access it.

您需要运行 window.top.frames [1] .src ='http://...'; .

window.top 意味着您将从主窗口运行此代码.

window.top means that you will run this code from the main window.

假设从第0帧单击了链接,然后在第1帧中打开了该链接.

Assuming that the link is clicked from frame 0 and opened in frame 1.

这篇关于将iFrame定位到另一页内的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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