访问iframe中的frameset元素 [英] Accessing frameset element inside iframe
本文介绍了访问iframe中的frameset元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试访问框架集中的frame src属性.但是document.getElementById('cntvars').firstChild为null.如何进入子元素?
I'm trying to access frame src attribute inside a frameset. But document.getElementById('cntvars').firstChild is null. How do I step into the child elements?
<iframe id="cntvars" onload="prstofrm();" src="http://sites.google.com" style="display:none"></iframe>
<html>
<head></head>
<frameset rows="100%,*" border="0">
<frame src="http://sites.google.com?qty=13.00&sub=7.24&shp=0.00&dis=0.00&vch=0.00&tax=0.00&tot=7.24&sd=" frameborder="0">
<frame frameborder="0" noresize="">
</frameset>
<!-- pageok -->
<!-- 04 -->
<!-- -->
</html>
</iframe>
推荐答案
您不能(除非您在Google工作并为sites.google.com
编写代码,但我认为不是).同源策略可防止父页面查看"存储在其他域中的框架的内容.
You can't (unless you're working at Google and writing code for sites.google.com
, which I assume you aren't). The same-origin policy prevents the parent page from "looking at" the contents of frames which are stored on other domains.
这篇关于访问iframe中的frameset元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文