Reputation: 133
I'm working on google chrome extension which logs multiple events. I have a problem with AJAX events. I found this code to log every single AJAX event:
document.addEventListener("DOMSubtreeModified", function(event){
console.log("AJAX event");
});
But it logs hundreds of them. Does anybody know how to distinguish which page element fired which event? And what caused the event (click, mouse move)?
Upvotes: 0
Views: 755
Reputation: 36955
You can get the event type by simply calling event.type
in your callback function. You should get click/mousemove/mouseover etc. Try console.log(event)
and see what else you can find too!
Upvotes: 2