Skip to main content

DOM Mutation event in JQuery or vanilla Javascript



Are there any DOM mutation events in JQuery or in vanilla Javascript that fire cross browser?





To clarify, say I have a script on my page which inserts a div into the body. I don't have access to the script and I don't know when the div has been inserted. I was wondering if there's a DOM mutation event that I can add a listener for to know when the div has been inserted. I know I can use some kind of timer to periodically check for the div but I don't really like the overhead that this would impose.



Source: Tips4all

Comments

  1. Not without a plugin, I believe, but I wouldn't be surprised if I'm wrong.

    My research has found a a few to choose from.

    Here's one: http://plugins.jquery.com/project/mutation-events

    Here's another: https://www.adaptavist.com/display/jQuery/Mutation+Events

    ReplyDelete

Post a Comment