jQuery watch for domElement changes?

前端 未结 4 2251
囚心锁ツ
囚心锁ツ 2020-12-02 18:31

I have an ajax callback which injects html markup into a footer div.

What I can\'t figure out is how to create a way to monitor the div for when it\'s contents chang

4条回答
  •  忘掉有多难
    2020-12-02 19:12

    There is a neat javascript library, mutation-summary by google, that lets you observe dom changes concisely. The great thing about it, is that if you want, you can be informed only of the actions that actually made a difference in the DOM, to understand what I mean you should watch the very informative video on the project's homepage.

    link: http://code.google.com/p/mutation-summary/

    jquery wrapper: https://github.com/joelpurra/jquery-mutation-summary

提交回复
热议问题