Compartilhar via


initMutationEvent method

Initializes a new Document Object Model (DOM) mutation (modification) event that the IDocumentEvent::createEvent method created.

 

Syntax

HRESULT retVal = object.initMutationEvent(eventType, canBubble, cancelable, relatedNodeArg, prevValueArg, newValueArg, attrNameArg, attrChangeArg);

Parameters

eventType [in]

Type: BSTR

One of the following values, or a user-defined custom event type.

DOMSubtreeModified

A general modification event. This event occurs for all changes to the document.

DOMNodeInserted

A node was inserted as a child of another node.

DOMNodeRemoved

A node was removed from its parent node.

DOMAttrModified

An attribute node has been changed. The value of the IDOMMutationEvent::attrChange property indicates whether the node was added, modified, or removed.

DOMCharacterDataModified

Character data within the node was modified. The target of the event is the text node.

canBubble [in]

Type: VARIANT_BOOL

VARIANT_TRUE (true)

The event should propagate upward.

VARIANT_FALSE (false)

The event does not propagate upward.

cancelable [in]

Type: VARIANT_BOOL

VARIANT_TRUE (true)

The default action can be canceled.

VARIANT_FALSE (false)

The default action cannot be canceled.

relatedNodeArg [in]

Type: IDispatch

A secondary node that is related to the event. This value is returned as the IDOMMutationEvent::relatedNode property of the event.

prevValueArg [in]

Type: BSTR

The previous value of the attribute or text node. This value is returned as the IDOMMutationEvent::prevValue property of the event.

newValueArg [in]

Type: BSTR

The new value of the attribute or text node. This value is returned as the IDOMMutationEvent::newValue property of the event.

attrNameArg [in]

Type: BSTR

The name of the changed attribute in a DOMAttrModified event. This value is returned as the IDOMMutationEvent::attrName property of the event.

attrChangeArg [in]

Type: unsigned short

The type of modification in a DOMAttrModified event. This value is returned as the IDOMMutationEvent::attrChange property of the event.

Return value

Type: HRESULT

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

Standards information

Remarks

The DOMNodeInsertedIntoDocument and DOMNodeRemovedFromDocument event type values are not supported.