Is it possible to listen to all javascript events?
I’m trying to guess if there’s an event triggered after the DOM is modified by an AJAX request.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
With firebug or web inspector you can use
monitorEvents:This prints all events emitted by
myDomElemto the console. UseunmonitorEventsto stop monitoring events.If you’re interested in getting events after the DOM has been manipulated, take a look at Mutation Events.
Edit:
As far as I know, there is no easy way to intercept all
onreadystatechangeevents from all XMLHttpRequest. The only work-around I can think of is to override the native XMLHttpRequest object with you own implementation. For example:Needless to say this is extremely hacky and generally ill-advised.