又是一个不熟悉的属性:
- https://hacks.mozilla.org/2012/05/dom-mutationobserver-reacting-to-dom-changes-without-killing-browser-performance/
- https://davidwalsh.name/mutationobserver-api
- http://chrisyip.github.io/post/mutation-events-and-mutationobserver/
- https://davidwalsh.name/mutationobserver-api
Mutation Observer(变动观察器)是监视DOM变动的接口。DOM发生任何变动,Mutation Observer会得到通知。
它与事件有一个本质不同:事件是同步触发,也就是说,当DOM发生变动,立刻会触发相应的事件;Mutation Observer则是异步触发,DOM发生变动以后,并不会马上触发,而是要等到当前所有DOM操作都结束后才触发。