Guest User

Untitled

a guest
Nov 19th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. var oldFunc = thirdParty.theirFunc;
  2. thirdParty.theirFunc = function(){
  3. oldFunc();
  4.  
  5. // alert myself of the change.
  6. myDomChangedFunction();
  7. };
  8.  
  9. .ajaxComplete()
  10.  
  11. MutationObserver
  12.  
  13. // select the target node
  14. var target = document.getElementById('some-id');
  15.  
  16. // create an observer instance
  17. var observer = new MutationObserver(function(mutations) {
  18. mutations.forEach(function(mutation) {
  19. console.log(mutation.type);
  20. });
  21. });
  22.  
  23. // configuration of the observer:
  24. var config = { attributes: true, childList: true, characterData: true };
  25.  
  26. // pass in the target node, as well as the observer options
  27. observer.observe(target, config);
  28.  
  29. // later, you can stop observing
  30. observer.disconnect();
Add Comment
Please, Sign In to add comment