Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

dispatchEvent method

Sends an event to the current element.

Document Object Model (DOM) Level 3 Events Specification, Section 4.3Internet Explorer 9

Syntax


HRESULT retVal = object.dispatchEvent(evt, pfResult);

Parameters

evt [in]

Type: IDOMEvent

The event object to dispatch.

pfResult [out, retval]

Type: VARIANT_BOOL

A VARIANT_BOOL value that indicates whether any of the event handlers called IDOMEvent::preventDefault.

VARIANT_TRUE (true)

Default. The default action is permitted.

VARIANT_FALSE (false)

The caller should prevent the default action.

Return value

Type: HRESULT

This method can return one of these values.

Return codeDescription
S_OK

The operation completed successfully.

NotSupportedError

You cannot dispatch an internal event.

 

Standards information

Remarks

Events that the IEventTarget::dispatchEvent method dispatches are subject to the same capturing and bubbling behavior as events that the browser dispatches.

You cannot cancel some events. For more information, see the documentation for the event.

See also

Reference
IEventTarget::addEventListener
IDocumentEvent::createEvent
IDOMEvent::initEvent

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.