Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>With <a href="http://getfirebug.com/wiki/index.php/Command_Line_API#monitorEvents.28object.5B.2C_types.5D.29" rel="noreferrer">firebug</a> or <a href="http://developer.apple.com/library/safari/#documentation/appleapplications/Conceptual/Safari_Developer_Guide/DebuggingYourWebsite/DebuggingYourWebsite.html" rel="noreferrer">web inspector</a> you can use <code>monitorEvents</code>:</p> <pre><code>monitorEvents(myDomElem); </code></pre> <p>This prints all events emitted by <code>myDomElem</code> to the console. Use <code>unmonitorEvents</code> to stop monitoring events.</p> <p>If you're interested in getting events after the DOM has been manipulated, take a look at <a href="http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-mutationevents" rel="noreferrer">Mutation Events</a>.</p> <p><strong>Edit</strong>:</p> <p>As far as I know, there is no easy way to intercept all <code>onreadystatechange</code> events from all XMLHttpRequest. The only work-around I can think of is to override the native XMLHttpRequest object with you own implementation. For example:</p> <pre><code>(function() { // Overriding XMLHttpRequest var oldXHR = window.XMLHttpRequest; function newXHR() { var realXHR = new oldXHR(); realXHR.addEventListener("readystatechange", function() { console.log("an ajax request was made") }, false); return realXHR; } window.XMLHttpRequest = newXHR; })(); </code></pre> <p>Needless to say this is extremely hacky and generally ill-advised.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload