首頁 資料庫 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脫衣器

Video Face Swap

Video Face Swap

使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

<🎜>:泡泡膠模擬器無窮大 - 如何獲取和使用皇家鑰匙
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
北端:融合系統,解釋
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
Mandragora:巫婆樹的耳語 - 如何解鎖抓鉤
3 週前 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)

熱門話題

Java教學
1664
14
CakePHP 教程
1423
52
Laravel 教程
1321
25
PHP教程
1269
29
C# 教程
1249
24
電腦主機板內部介面都有什麼 推薦電腦主機板內部介面介紹 電腦主機板內部介面都有什麼 推薦電腦主機板內部介面介紹 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()的原因可能是因為未實作某個抽象方法或介面。這些方法或介面在父類別中聲明,但在子類別中未實作。子類別需要實作這些方法或介面才能正常運作。如何解決解決這個問題的方法是在子類別中實作父類別聲明的抽象方法或介面。如果您正在使用一個類別來繼承另一個類,並且您看到了這個錯誤,則應該在子類別中實作父類別中所有聲明的抽象方法。如果您正在使用一個接口,並且您看到了這個錯誤,則應該在實作該接口的類別中實作該接口中所有聲明的方法。如果您不確定哪些

Java 中介面與抽象類別在設計模式中的應用 Java 中介面與抽象類別在設計模式中的應用 May 01, 2024 pm 06:33 PM

介面和抽象類別在設計模式中用於解耦和可擴展性。介面定義方法簽名,抽象類別提供部分實現,子類別必須實作未實現的方法。在策略模式中,介面用於定義演算法,抽象類別或具體類別提供實現,允許動態切換演算法。在觀察者模式中,介面用於定義觀察者行為,抽象類別或具體類別用於訂閱和發布通知。在適配器模式中,介面用於適應現有類,抽象類或具體類可實現相容接口,允許與原有程式碼互動。

PHP中的介面和抽象類別有何不同? PHP中的介面和抽象類別有何不同? Jun 04, 2024 am 09:17 AM

介面和抽象類別用於建立可擴展的PHP程式碼,它們之間存在以下關鍵差異:介面透過實作強制執行,而抽象類別透過繼承強制執行。介面不能包含具體方法,而抽象類別可以。一個類別可以實作多個接口,但只能從一個抽象類別繼承。介面不能實例化,而抽象類別可以。

透視鴻蒙系統:功能實測與使用感受 透視鴻蒙系統:功能實測與使用感受 Mar 23, 2024 am 10:45 AM

鴻蒙系統作為華為推出的全新作業系統,在業界引起了不小的轟動。作為華為在美國禁令之後的全新嘗試,鴻蒙系統被寄予了厚望和期待。近日,我有幸得到了一部搭載鴻蒙系統的華為手機,經過一段時間的使用和實測,我將分享一些關於鴻蒙系統的功能實測和使用感受。首先,讓我們來看看鴻蒙系統的介面和功能。鴻蒙系統整體採用了華為自家的設計風格,簡潔清晰,操作流暢。在桌面上,各種

Java 中介面和抽象類別的內部類別實現 Java 中介面和抽象類別的內部類別實現 Apr 30, 2024 pm 02:03 PM

Java允許在介面和抽象類別中定義內部類別,為程式碼重複使用和模組化提供靈活性。介面中的內部類別可實現特定功能,而抽象類別中的內部類別可定義通用功能,子類別提供具體實作。

See all articles