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