如何访问框架内的框架?

时间:2011-09-05 08:09:39

标签: javascript html

<iframe name="aa">
  <iframe name="bb">
  </iframe> 
  <iframe name="cc">
  </iframe> 
</iframe>

(假设上面显示的iframe具有所有必需的属性。)

我可以在原生javascript中获取名称=“aa”的帧的子帧吗?
浏览器将它们全部渲染,没问题。
我正在尝试 frame.frames 来获取内部帧的数组,其中frame是外部帧的帧对象,即“aa”。但它没有用。
甚至可能吗?
任何帮助???



非常感谢。

1 个答案:

答案 0 :(得分:2)

你可以这样做,但是因为每个iframe在技术上都在加载另一个页面,所以你必须将它编码到第一个iframe加载的实际网页中。

进一步解释......

<iframe name"aa"></iframe> <!-- this is coded into the first page calling the page below //-->


<iframe name="bb"></iframe> <!-- coded into the second page calling another page //-->
<iframe name="cc"></iframe> <!-- coded into the second page calling anothe page //-->

请记住,iframe只是进入其他页面的“窗口”。

相关问题