Horje
mutation observer Code Example
mutation observer js
const observer = new MutationObserver(list => {
    console.log('mutation list', list);
});
observer.observe(document.body, {
    attributes: true,
    childList: true,
    subtree: true
});
// perform any DOM change action in your page. e.g. show/hide/remove
mutation observer
  var composeObserver = new MutationObserver(function(mutations){ 
    mutations.forEach(function(mutation){
      console.log("MUTATE:", mutation)
    });
});


  function addObserverIfDesiredNodeAvailable() {
    console.log('calling')
    var composeBox = document.querySelector(".title");
    console.log("compose box: ", composeBox);
    if(!composeBox) {
        //The node we need does not exist yet.
        //Wait 500ms and try again
        window.setTimeout(addObserverIfDesiredNodeAvailable,500);
        return;
    }
    var config = {childList: true};
    composeObserver.observe(composeBox,config);
}
addObserverIfDesiredNodeAvailable();




Javascript

Related
change previous location history javascript Code Example change previous location history javascript Code Example
isphonenumber javascript Code Example isphonenumber javascript Code Example
asciicinema Code Example asciicinema Code Example
validators.pattern angular number Code Example validators.pattern angular number Code Example
move element jquery Code Example move element jquery Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
9