title: Is it possible to react to an AJAX response from outside the xhttp object?
body: <p>I have a unified AJAX request that always does the same thing (fetch data and display it in a table).</p>
  
  <p>I'd like to extend this functionality now. I have a table where I can select table rows and they will become marked.</p>
  
  <p>The problem now is: If I use the pagination to go to a different page and back, the mark on every row is lost.</p>
  
  <p>I'd like to call a function that marks the rows again. How do I call the function after my original AJAX completes - without modifying the original AJAX's <code>onreadystatechange</code>?</p>
  
  <p>Essentially, I'm looking for something like "document.onajaxcompletion"</p>
  
  <p>It doesn't matter if it executes on any non-specific AJAX call either</p>
  
  <p>Pseudo-code:</p>
  
  <pre><code>document.addEventListener("ajaxcompletion", function() { myRowUpdater(); });
  </code></pre>