Foxtable(狐表)用户栏目专家坐堂 → 狐表如何操作网页中里面的iframe的document


  共有2655人关注过本帖平板打印复制链接

主题:狐表如何操作网页中里面的iframe的document

帅哥哟,离线,有人找我吗?
Fotable
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:五尾狐 帖子:1015 积分:6979 威望:0 精华:0 注册:2012/8/1 18:41:00
狐表如何操作网页中里面的iframe的document  发帖心情 Post By:2015/7/22 0:11:00 [只看该作者]

 

 

我们知道document对象是window对象的一个子对象,所以我们可以通过 document.getElementById(“iframe ID”).contentWindow.document来获取iframe的 document对象,相当于contentDocument属性。

 

用vb测试

Dim doc As HTMLDocument
Set doc = WebBrowser1.document
Dim t As IHTMLElement
Dim a As HTMLDocument
Set a = doc.getElementById("ueditor_0").contentWindow.document

这些语句是没有问题的

 

但在狐表中使用这个方法

'Dim htmFrame As System.Windows.Forms.Htmldocument= web.Document.GetElementById("ueditor_0").contentwindow.document    'ueditor_0  指向一个iframe

 

未找到类型“HtmlElement”的公共成员“contentWindow”。


 回到顶部