Skip to content

Instantly share code, notes, and snippets.

@HaQadosch
Created December 9, 2014 23:17
Show Gist options
  • Save HaQadosch/f105967f56ac56f30c15 to your computer and use it in GitHub Desktop.
Save HaQadosch/f105967f56ac56f30c15 to your computer and use it in GitHub Desktop.
Observer
$('div.src-accomRooms-container button.btnSelectRoom').on('click', function clickButonRoom(e){
})
MutationObserver = window.MutationObserver || window.WebKitMutationObserver
var observer = new MutationObserver(function(mutations, observer) {
// fired when a mutation occurs
console.info(mutations, observer);
// Use of the information here.
});
observer.observe(document, {
subtree: true,
attributes: true
//...
});
// select the target node
var target = document.querySelector('#priceTicketPanel.priceTicketPanel');
// create an observer instance
var observer = new MutationObserver(function(mutations, observer) {
console.info(mutations)
mutations.forEach(function(mutation) {
console.log(mutation.target.childnodes[0].childnodes[3].childnodes[1].data);
});
console.info(observer)
});
// 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();
$('div.priceTicket-priceDetailsBox.clearfix')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment