首页 数据库 mysql教程 IHTMLElement和IHTMLElement2接口

IHTMLElement和IHTMLElement2接口

Jun 07, 2016 pm 03:49 PM
接口

IHTMLElement和IHTMLElement2是IE浏览器(WebBrowser控件,trident内核)的两个同系列针对文档元素的接口。这两个接口都提供了以编程方式访问常见的所有元素对象的属性和方法的途径。 一、 下面还是先介绍IHTMLElement接口 。 IHTMLElement接口里有不少的变量和

        IHTMLElement和IHTMLElement2是IE浏览器(WebBrowser控件,trident内核)的两个同系列针对文档元素的接口。这两个接口都提供了以编程方式访问常见的所有元素对象的属性和方法的途径。

       一、下面还是先介绍IHTMLElement接口

      IHTMLElement接口里有不少的变量和函数,其变量大多是文档元素的属性,比如class、id、attribute、lang、tagName、InnerText、InnerHtml、OuterText、OuterHtml、child、parentElement等,还有部分是style属性,比如offsetHeight、offsetLeft、style等,另外有一部分关于该元素的动作属性,比如onclick、ondragstart、onmousedown、onmousemove等。在这些成员属性之外,还有成员方法,比如click()、getAttribute(..),另外一部分成员方法就是针对各个成员变量安排的成员函数(getXX、setXX),比如id这个属性,HRESULT get_id(BSTR *p)、HRESULT put_id(BSTR *p),对于onmousedown这个成员属性,其对应的成员函数是HRESULT get_onmousedown(VARIANT *p)、HRESULT put_onmousedown(VARIANT *p),其中VARIANT是VT_IDISPATCH类型,其细化了IDispatch接口。

all                  Retrieves the collection of all the objects in the HTML that are within the scope of this object.

children         Retrieves the collection that contains all the immediate children of this object.

className    Sets or retrieves the class of the object.

click              Simulates a click by causing the onclick event to fire.

contains       Checks whether the given element is contained within the object.

document     Gets the document object for the document that the browser is displaying.

filters            Retrieves a collection of filters for an element.

getAttribute    Retrieves the value of the specified attribute.

id                  Sets or retrieves the string identifying the object.

innerHTML    Gets or sets the HTML between the start and end tags of the object.

innerText      Sets or retrieves the text between the start and end tags of the object.

insertAdjacentHTML         Inserts the given HTML text into the element at the location.

insertAdjacentText              Inserts the given text into the element at the specified location.

isTextEdit       Retrieves whether a TextRange object can be created using the object.

lang                Sets or retrieves the language to use.

language       Sets or retrieves the language in which the current script is written.

offsetHeight                     Retrieves the height of the object relative to the layout or coordinate parent, as specified by the IHTMLElement::offsetParent property.

offsetLeft                         Retrieves the calculated left position of the object relative to the layout or coordinate parent, as specified by the IHTMLElement::offsetParent property.

offsetParent                                                   Retrieves a reference to the container object that defines the IHTMLElement::offsetTop and IHTMLElement::offsetLeft properties of the object.

offsetTop                         Retrieves the calculated top position of the object relative to the layout or coordinate parent, as specified by the IHTMLElement::offsetParent property.

offsetWidth                     Retrieves the width of the object relative to the layout or coordinate parent, as specified by the IHTMLElement::offsetParent property.

onafter              updateSets or retrieves a pointer to the event handler function associated with the onafterupdate event.

onbeforeupdate            Sets or retrieves a pointer to the event handler function associated with the onbeforeupdate event.

onclick              Sets or retrieves a pointer to the event handler function associated with the onclick event.

ondataavailable             Sets or retrieves a pointer to the event handler function associated with the ondataavailable event.

ondatasetchanged        Sets or retrieves a pointer to the event handler function associated with the ondatasetchanged event.

ondatasetcomplete       Sets or retrieves a pointer to the event handler function associated with the ondatasetcomplete event.

ondblclick                      Sets or retrieves a pointer to the event handler function associated with the ondblclick event.

ondragstart                   Sets or retrieves a pointer to the event handler function associated with the ondragstart event.

onerrorupdate              Sets or retrieves a pointer to the event handler function associated with the onerrorupdate event.

onfilterchange              Sets or retrieves a pointer to the event handler function associated with the event.

onhelp                           Sets or retrieves a pointer to the event handler function associated with the onhelp event.

onkeydown                   Sets or retrieves a pointer to the event handler function associated with the onkeydown event.

onkeypress                  Sets or retrieves a pointer to the event handler function associated with the onkeypress event.

onkeyup                       Sets or retrieves a pointer to the event handler function associated with the onkeyup event.

onmousedown             Sets or retrieves a pointer to the event handler function associated with the onmousedown event.

onmousemove            Sets or retrieves a pointer to the event handler function associated with the onmousemove event.

onmouseout                Sets or retrieves a pointer to the event handler function associated with the onmouseout event.

onmouseover              Sets or retrieves a pointer to the event handler function associated with the onmouseover event.

onmouseup                 Sets or retrieves a pointer to the event handler function associated with the onmouseup event.

onrowenter                 Sets or retrieves a pointer to the event handler function associated with the onrowenter event.

onrowexit                    Sets or retrieves a pointer to the event handler function associated with the onrowexit event.

onselectstart              Sets or retrieves a pointer to the event handler function associated with the onselectstart event.

outerHTML                 Sets or retrieves the object and its content in HTML.

outerText                   Sets or retrieves the text of the object.

parentElement         Retrieves the parent object in the object hierarchy.

parentTextEdit         Retrieves the container object in the document hierarchy that can be used to create a TextRange containing the original object.

recordNumber         Retrieves the ordinal record from the data set that generated the object.

removeAttribute      Removes an attribute from an object.

scrollIntoView          Causes the object to scroll into view, aligning it either at the top or bottom of the window.

setAttribute              Sets the value of the specified attribute.

sourceIndex            Retrieves the ordinal position of the object, in source order, as the object appears in the document's all collection.

style                         Retrieves an inline style sheet for the tag.

tagName                 Retrieves the tag name of the object.

title                         Sets or retrieves advisory information (a ToolTip) for the object.

toString                   Retrieves a string representation of the object.

二、IHTMLElement2接口的介绍

      IHTMLElement2是在IHTMLElement接口基础上加了一些成员属性和方法,以满足浏览器升级的需求。其加的属性,如readyState、readyStateValue、currentStyle、与scroll(滑动条)有关的几个属性、capture、expression、behavior等属性及其设置与删除。

onpropertychange          Sets or retrieves a pointer to the event handler function associated with the onpropertychange event.

onreadystatechange      Sets or retrieves a pointer to the event handler function associated with the onreadystatechange event.

onresize                         Sets or retrieves a pointer to the event handler function associated with the onresize event.

onrowsdelete                 Sets or retrieves a pointer to the event handler function associated with the onrowsdelete event.

onrowsinserted             Sets or retrieves a pointer to the event handler function associated with the onrowsinserted event.

onscroll                         Sets or retrieves a pointer to the event handler function associated with the onscroll event.

readyState                    Retrieves the current state of the object.

readyStateValue           Gets the current state of the object.

releaseCapture             Removes mouse capture from the object in the current document.

removeBehavior            Detaches a behavior from the element.

removeExpression        Removes the expression from the specified property.

removeFilter                 Not implemented.

replaceAdjacentText    Replaces the text adjacent to the element.

runtimeStyle                Gets the element's runtimeStyle object.

scopeName                 Gets the namespace defined for the element.

scrollHeight                 Retrieves the scrolling height of the object.

scrollLeft                     Sets or retrieves the distance between the left edge of the object and the leftmost portion of the content currently visible in the window.

scrollTop                     Sets or retrieves the distance between the top of the object and the topmost portion of the content currently visible in the window.

scrollWidth                 Retrieves the scrolling width of the object.

setCapture                Sets the mouse capture to the object that belongs to the current document.

setExpression           Sets an expression for the specified object.

tabIndex                   Sets or retrieves the index that defines the tab order for the object.

tagUrn                       Sets or gets the URN specified in the namespace declaration.

canHaveChildren      Gets a value indicating whether the object can contain child objects.

        下面说下IHTMLElement2接口的版本等问题。注意,IHTMLElement接口只需要IE4及其以上版本即可。

      Interface Information

Stock Implementation                            mshtml.dll

Custom Implementation                          No

Inherits from                                            IDispatch

Header and IDL files                                Mshtml.h, Mshtml.idl

Minimum availability                                  Internet Explorer5

Minimum operating systems                      Windows 95, Windows NT 4.0, Windows CE 4.0


本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热AI工具

Undresser.AI Undress

Undresser.AI Undress

人工智能驱动的应用程序,用于创建逼真的裸体照片

AI Clothes Remover

AI Clothes Remover

用于从照片中去除衣服的在线人工智能工具。

Undress AI Tool

Undress AI Tool

免费脱衣服图片

Clothoff.io

Clothoff.io

AI脱衣机

AI Hentai Generator

AI Hentai Generator

免费生成ai无尽的。

热门文章

R.E.P.O.能量晶体解释及其做什么(黄色晶体)
2 周前 By 尊渡假赌尊渡假赌尊渡假赌
仓库:如何复兴队友
4 周前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒险:如何获得巨型种子
4 周前 By 尊渡假赌尊渡假赌尊渡假赌

热工具

记事本++7.3.1

记事本++7.3.1

好用且免费的代码编辑器

SublimeText3汉化版

SublimeText3汉化版

中文版,非常好用

禅工作室 13.0.1

禅工作室 13.0.1

功能强大的PHP集成开发环境

Dreamweaver CS6

Dreamweaver CS6

视觉化网页开发工具

SublimeText3 Mac版

SublimeText3 Mac版

神级代码编辑软件(SublimeText3)

电脑主板内部接口都有什么 推荐电脑主板内部接口介绍 电脑主板内部接口都有什么 推荐电脑主板内部接口介绍 Mar 12, 2024 pm 04:34 PM

我们在电脑组装的过程中,安装过程虽然简单,不过往往都是在接线上遇到问题,经常有装机用户误将CPU散热器的供电线插到了SYS_FAN上,虽然风扇可以转动,不过在开机可能会有F1报错“CPUFanError”,同时也导致了CPU散热器无法智能调速。下面装机之家分享一下电脑主板上CPU_FAN、SYS_FAN、CHA_FAN、CPU_OPT接口知识科普。电脑主板上CPU_FAN、SYS_FAN、CHA_FAN、CPU_OPT接口知识科普1、CPU_FANCPU_FAN是CPU散热器专用接口,12V工作

Go语言中常见的编程范式和设计模式 Go语言中常见的编程范式和设计模式 Mar 04, 2024 pm 06:06 PM

Go语言作为一门现代化的、高效的编程语言,拥有丰富的编程范式和设计模式可以帮助开发者编写高质量、可维护的代码。本文将介绍Go语言中常见的编程范式和设计模式,并提供具体的代码示例。1.面向对象编程在Go语言中,可以使用结构体和方法实现面向对象编程。通过定义结构体和给结构体绑定方法,可以实现数据封装和行为绑定在一起的面向对象特性。packagemaini

PHP接口简介及其定义方式 PHP接口简介及其定义方式 Mar 23, 2024 am 09:00 AM

PHP接口简介及其定义方式PHP是一种广泛应用于Web开发的开源脚本语言,具有灵活、简单、强大等特点。在PHP中,接口(interface)是一种定义多个类之间公共方法的工具,实现了多态性,让代码更加灵活和可重用。本文将介绍PHP接口的概念及其定义方式,同时提供具体的代码示例展示其用法。1.PHP接口概念接口在面向对象编程中扮演着重要的角色,定义了类应

NotImplementedError()的处理方案 NotImplementedError()的处理方案 Mar 01, 2024 pm 03:10 PM

报错的原因在python中,Tornado中抛出NotImplementedError()的原因可能是因为未实现某个抽象方法或接口。这些方法或接口在父类中声明,但在子类中未实现。子类需要实现这些方法或接口才能正常工作。如何解决解决这个问题的方法是在子类中实现父类声明的抽象方法或接口。如果您正在使用一个类来继承另一个类,并且您看到了这个错误,则应该在子类中实现父类中所有声明的抽象方法。如果您正在使用一个接口,并且您看到了这个错误,则应该在实现该接口的类中实现该接口中所有声明的方法。如果您不确定哪些

透视鸿蒙系统:功能实测与使用感受 透视鸿蒙系统:功能实测与使用感受 Mar 23, 2024 am 10:45 AM

鸿蒙系统作为华为推出的全新操作系统,在行业内引起了不小的轰动。作为华为在美国禁令之后的一次全新尝试,鸿蒙系统被寄予了厚望和期待。近日,我有幸得到了一部搭载鸿蒙系统的华为手机,经过一段时间的使用和实测,我将分享一些关于鸿蒙系统的功能实测和使用感受。首先,让我们来看一下鸿蒙系统的界面和功能。鸿蒙系统整体采用了华为自家的设计风格,简洁清晰,操作流畅。在桌面上,各种

Java 中接口和抽象类的内部类实现 Java 中接口和抽象类的内部类实现 Apr 30, 2024 pm 02:03 PM

Java允许在接口和抽象类中定义内部类,为代码重用和模块化提供灵活性。接口中的内部类可实现特定功能,而抽象类中的内部类可定义通用功能,子类提供具体实现。

Java 接口与抽象类:揭示它们之间的内在联系 Java 接口与抽象类:揭示它们之间的内在联系 Mar 04, 2024 am 09:34 AM

接口接口在Java中定义了抽象方法和常量。接口中的方法没有实现,而是由实现该接口的类来提供。接口定义了合同,要求实现类提供指定的方法实现。声明接口:publicinterfaceExampleInterface{voiddoSomething();intgetSomething();}抽象类抽象类是一个不能被实例化的类。它包含抽象方法和非抽象方法的混合。与接口类似,抽象类中的抽象方法由子类实现。但是,抽象类还可以包含具体的方法,这些方法提供了默认实现。声明抽象类:publicabstractcl

Golang中有类似类的编程概念吗? Golang中有类似类的编程概念吗? Mar 19, 2024 am 10:12 AM

在Golang(Go语言)中,虽然没有类似传统面向对象编程语言中的类的概念,但是可以通过结构体和方法来实现类似的功能。在Golang中,我们可以定义一个结构体来封装数据,并为结构体定义方法来操作数据,这种方式可以实现面向对象编程中类的基本功能。首先,我们来看一个简单的例子,定义一个名为Person的结构体,包含name和age两个字段,并为Person结构体

See all articles