Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var oldFunc = thirdParty.theirFunc;
- thirdParty.theirFunc = function(){
- oldFunc();
- // alert myself of the change.
- myDomChangedFunction();
- };
- .ajaxComplete()
- MutationObserver
- // select the target node
- var target = document.getElementById('some-id');
- // create an observer instance
- var observer = new MutationObserver(function(mutations) {
- mutations.forEach(function(mutation) {
- console.log(mutation.type);
- });
- });
- // configuration of the observer:
- var config = { attributes: true, childList: true, characterData: true };
- // pass in the target node, as well as the observer options
- observer.observe(target, config);
- // later, you can stop observing
- observer.disconnect();
Add Comment
Please, Sign In to add comment