Availability: |
| ||||
JavaScript syntax: | N | myMutationEvent.initMutationEvent(aType, aBubble, aCancel, aNode, aPrev, aNew, aName) | |||
Argument list: | aType | A string containing the event type | |||
aBubble | A boolean value indicating whether the event can bubble | ||||
aCancel | A boolean value indicating whether the event can be cancelled | ||||
aNode | A reference to a related Node object | ||||
aPrev | A string containing the previous value | ||||
aNew | A string containing the new value | ||||
aName | A string containing the name of an attribute |
A new event object is manufactured by calling the DocumentEvent.createEvent() method. That event should have been defined with a type specified as "MutationEvent". If it was, then it will support an initMutationEvent() method. This must be called before the event is dispatched otherwise the event object will not contain enough information for the event dispatcher/handler to make sense of it and route it to the correct target objects.
Two boolean argument values define whether the event will be allowed to be cancelled and what type of propagation to use (bubble or capture).
You can add a reference to a related node and can also define previous and new values if you are simulating an attribute change. Finally for an attribute change, the attribute name can be specified.
See also: | Event.target, EventTarget object, Node object |
Prev | Home | Next |
MutationEvent.attrName | Up | MutationEvent.newValue |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |