Modifier and Type | Class and Description |
---|---|
static interface |
MutationObserver.MutationObserverCallback
A function which will be called on each DOM change that qualifies given the targeted node or subtree and options.
|
Constructor and Description |
---|
MutationObserver(MutationObserver.MutationObserverCallback callback)
Creates and returns a new mutation observer which will invoke a specified callback function when DOM changes occur.
|
Modifier and Type | Method and Description |
---|---|
void |
disconnect()
Stops the mutation observer instance from receiving further notifications until and unless
observe(BaseNode) is called again. |
void |
observe(BaseNode target)
Configures the mutation observer to begin receiving notifications through its callback function when DOM changes matching the given options occur.
|
void |
observe(BaseNode target,
MutationObserverInit options)
Configures the mutation observer to begin receiving notifications through its callback function when DOM changes matching the given options occur.
|
MutationRecord[] |
takeRecords()
Removes all pending notifications from the mutation observer's notification queue and returns them in a new array of mutation record objects.
|
public MutationObserver(MutationObserver.MutationObserverCallback callback)
callback
- a function which will be called on each DOM change that qualifies given the targeted node or subtree and optionspublic void disconnect()
observe(BaseNode)
is called again.public void observe(BaseNode target, MutationObserverInit options)
target
- a DOM node within the DOM tree to watch for changes, or to be the root of a subtree of nodes to be watchedoptions
- initialization object providing options that describe what DOM mutations should be reported to the observer's callbackpublic void observe(BaseNode target)
target
- a DOM node within the DOM tree to watch for changes, or to be the root of a subtree of nodes to be watchedpublic MutationRecord[] takeRecords()