Click to Rate and Give Feedback
MSDN
MSDN Library
Web Development
Internet Explorer
Legacy APIs
Hosting and Reuse
MSHTML Reference
IHTMLElement2
 detachEvent method
detachEvent method

[This documentation is preliminary and is subject to change.]

Unbinds the specified function from the event, so that the function stops receiving notifications when the event fires.

Syntax

HRESULT retVal = object.detachEvent(event, pDisp);

Standards information

There are no standards that apply here.

Parameters

event [in]

Type: BSTR

BSTR that specifies any of the standard DHTML Events.

pDisp [in]

Type: IDispatch

Pointer to an IDispatch interface that specifies the function previously set using the IHTMLElement2::attachEvent method.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

Behaviors that attach to events using the IHTMLElement2::attachEvent method must explicitly call the IHTMLElement2::detachEvent method to stop receiving notifications from the page when the ondetach event fires. Behaviors that attach to events using the PUBLIC:ATTACH element automatically stop receiving notifications when the behavior detaches from the element, and thus do not need to call the IHTMLElement2::detachEvent method.

See also

Reference
IHTMLElement2::attachEvent
Conceptual
Introduction to DHTML Behaviors
Using DHTML Behaviors
Using HTML Components to Implement DHTML Behaviors in Script

 

 

Build date: 3/8/2012

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2012 Microsoft. All rights reserved. Terms of Use | Trademarks | Privacy Statement
Page view tracker