- Index
- »
- dom
- »
- MutationObserver
type
MutationObserver
src
@Js
class MutationObserver : Obj
MutationObserver invokes a callback when DOM modifications occur.
constructors
make |
Constructor. |
---|
methods
disconnect |
Disconnect this observer from receiving DOM mutation events. |
---|---|
observe |
Register to receive DOM mutation events for given node. |
takeRecs |
Empties this observers's record queue and returns what was in there. |
Slot Details
disconnect
make
src
new make(|MutationRec[]| callback)
Constructor.
observe
src
This observe(Elem target, Str:Obj opts)
Register to receive DOM mutation events for given node. At least one option is required:
- "childList":
true
to observe node additions and removals on target (including text nodes) - "attrs":
true
to observe target attribute mutations - "charData":
true
to observe target data mutation - "subtree":
true
to observe target and target's descendant mutations - "attrOldVal":
true
to capture attribute value before mutation (requires "attrs":'true') - "charDataOldVal":
true
to capture target's data before mutation (requires "charData":'true') - "attrFilter": Str[] whitelist of attribute names to observe (requires "attrs":'true')
takeRecs
src
MutationRec[] takeRecs()
Empties this observers's record queue and returns what was in there.