What I want to do is have a “live” function that monitors the existance of a classname, and if any event causes that classname to be added anywhere in the DOM, another function will be fired.
How do I write a function that does that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This kind of functionality does not exist in jQuery and will not be added because the methods required to implement it are depreciated by browsers. Source: https://forum.jquery.com/topic/a-global-event-or-simple-callback-for-new-content-entering-the-page-specifically-for-applying-widgets-and-behaviour#14737000003041291
However, on that same post, there’s mention of a plugin that does this.
https://github.com/snesin/jcade