IHTMLElement和IHTMLElement2接口
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

핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

AI Hentai Generator
AI Hentai를 무료로 생성하십시오.

인기 기사

뜨거운 도구

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)

뜨거운 주제











컴퓨터를 조립할 때 설치 과정은 간단하지만 배선에 문제가 발생하는 경우가 종종 있습니다. 컴퓨터가 켜지면 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 언어의 일반적인 프로그래밍 패러다임과 디자인 패턴을 소개하고 구체적인 코드 예제를 제공합니다. 1. 객체지향 프로그래밍 Go 언어에서는 구조와 메소드를 사용하여 객체지향 프로그래밍을 구현할 수 있습니다. 구조를 정의하고 구조에 대한 바인딩 방법을 통해 데이터 캡슐화 및 동작 바인딩의 객체 지향 기능을 구현할 수 있습니다. 패키지메니

PHP 인터페이스 소개 및 정의 방법 PHP는 웹 개발에 널리 사용되는 오픈 소스 스크립팅 언어입니다. 유연하고 간단하며 강력합니다. PHP에서 인터페이스는 여러 클래스 간의 공통 메서드를 정의하여 다형성을 달성하고 코드를 보다 유연하고 재사용 가능하게 만드는 도구입니다. 이 기사에서는 PHP 인터페이스의 개념과 이를 정의하는 방법을 소개하고 사용법을 보여주는 특정 코드 예제를 제공합니다. 1. PHP 인터페이스 개념 인터페이스는 클래스 애플리케이션을 정의하는 객체 지향 프로그래밍에서 중요한 역할을 합니다.

오류의 원인은 Python입니다. Tornado에서 NotImplementedError()가 발생하는 이유는 추상 메서드나 인터페이스가 구현되지 않았기 때문일 수 있습니다. 이러한 메서드나 인터페이스는 상위 클래스에서 선언되지만 하위 클래스에서는 구현되지 않습니다. 서브클래스가 제대로 작동하려면 이러한 메서드나 인터페이스를 구현해야 합니다. 이 문제를 해결하는 방법은 부모 클래스에서 선언한 추상 메서드나 인터페이스를 자식 클래스에 구현하는 것입니다. 다른 클래스에서 상속하기 위해 클래스를 사용하는 경우 이 오류가 표시되면 상위 클래스에 선언된 모든 추상 메서드를 하위 클래스에 구현해야 합니다. 인터페이스를 사용하고 있는데 이 오류가 표시되면 인터페이스를 구현하는 클래스의 인터페이스에 선언된 모든 메서드를 구현해야 합니다. 어느 것이 확실하지 않은 경우

Huawei가 출시한 새로운 운영 체제인 Hongmeng 시스템은 업계에 큰 반향을 불러일으켰습니다. 미국의 금지 조치 이후 화웨이가 시도한 새로운 시도인 훙멍(Hongmeng) 시스템은 큰 기대와 기대를 모으고 있다. 최근에는 운이 좋게도 Hongmeng 시스템이 탑재된 Huawei 휴대폰을 구입하게 되었습니다. 일정 기간의 사용과 실제 테스트를 거쳐 Hongmeng 시스템의 일부 기능 테스트와 사용 경험을 공유하겠습니다. 먼저 Hongmeng 시스템의 인터페이스와 기능을 살펴보겠습니다. Hongmeng 시스템은 전체적으로 Huawei 고유의 디자인 스타일을 채택하여 작동이 간단하고 명확하며 원활합니다. 데스크탑에서는 다양한

Java를 사용하면 인터페이스 및 추상 클래스 내에서 내부 클래스를 정의할 수 있으므로 코드 재사용 및 모듈화에 대한 유연성이 제공됩니다. 인터페이스의 내부 클래스는 특정 기능을 구현할 수 있고, 추상 클래스의 내부 클래스는 일반 기능을 정의할 수 있으며, 서브클래스는 구체적인 구현을 제공합니다.

인터페이스와 추상 클래스는 분리 및 확장성을 위해 디자인 패턴에 사용됩니다. 인터페이스는 메서드 시그니처를 정의하고 추상 클래스는 부분 구현을 제공하며 하위 클래스는 구현되지 않은 메서드를 구현해야 합니다. 전략 패턴에서는 인터페이스를 사용하여 알고리즘을 정의하고 추상 클래스 또는 구상 클래스를 통해 구현을 제공하므로 알고리즘을 동적으로 전환할 수 있습니다. 관찰자 패턴에서 인터페이스는 관찰자 동작을 정의하는 데 사용되며 추상 또는 구체적인 클래스는 알림을 구독하고 게시하는 데 사용됩니다. 어댑터 패턴에서 인터페이스는 기존 클래스를 조정하는 데 사용됩니다. 추상 클래스 또는 구체적인 클래스는 호환되는 인터페이스를 구현하여 원본 코드와 상호 작용할 수 있습니다.

인터페이스 인터페이스는 Java의 추상 메소드와 상수를 정의합니다. 인터페이스의 메서드는 구현되지 않지만 인터페이스를 구현하는 클래스에서 제공됩니다. 인터페이스는 구현 클래스가 지정된 메서드 구현을 제공하도록 요구하는 계약을 정의합니다. 인터페이스를 선언합니다. publicinterfaceExampleInterface{voiddoSomething();intgetSomething();} 추상 클래스 추상 클래스는 인스턴스화할 수 없는 클래스입니다. 여기에는 추상 메서드와 비추상 메서드가 혼합되어 있습니다. 인터페이스와 마찬가지로 추상 클래스의 추상 메서드는 하위 클래스에 의해 구현됩니다. 그러나 추상 클래스에는 기본 구현을 제공하는 구체적인 메서드가 포함될 수도 있습니다. 추상 클래스 선언: publicabstractcl
