2010-11-22 48 views
0

您好,我想通过使用document.getElementById('frame_name')。contentWindow.document.body.scrollHeight获取Iframe滚动高度。但这个代码不工作,直到document.getElementById('frame_name')。contentWindow我能够得到对象,但之后得到'未定义'错误试图访问iframe文档像document.getElementById('frame_name')。contentWindow.documentiframe scrollHeight在Chrome 5版本

+0

检查此链接。它可能会给你你正在寻找的东西。 http://www.dynamicdrive.com/dynamicindex17/iframessi2.htm – 2010-11-22 09:57:16

+0

给出的链接代码不适用于Chrome浏览器 – prakashkadakol 2010-11-22 10:12:39

回答

0

如果您正在为Chrome插件构建此应用,则目前存在帧/ iframe错误。请参阅http://code.google.com/p/chromium/issues/detail?id=20773

从错误报告:

哪些步骤将重现该问题?

从内容脚本

什么是预期的结果尝试访问window.frames [some_index]?

我们拿到的框架

,而不是会发生什么?

对于所有n,window.frames [N] =未定义