title: How can I run a Greasemonkey function after an AJAX update?
body: <p>I have a GM script that adds buttons next to certain hyperlinks on Facebook pages. However, any AJAX update nukes the buttons in that section of page (i.e. when you click 'view more comments' - all the buttons on that thread vanish)</p>
  
  <p>What I <strong>desire to do:</strong><br>
  Re-run my GM function after certain AJAX operations complete - mainly when viewing more comments &amp; loading a new page (I.e click to a different group page, this is all AJAXed)  </p>
  
  <p>what I <strong>currently do:</strong><br>
  Have a 30 second loop that just re-runs my code every 30 seconds. not ideal. Setting a shorter loop will just cause lag<br>
  <em>Edit - it actually makes more and more buttons.</em> Super <em>not ideal</em>!</p>
  
  <p><strong>How you can help:</strong><br>
  what code should I use to trigger my function after AJAX finishes loading something?  What should I be doing so that my code only fires upon my desired AJAX updates, such as the 'new page' &amp; 'more comments' updates?<br>
  <em>Edit - I need to re-run my code only on the updated bit (is this even possible?)</em></p>
  
  <p>Notes:<br>
  I have searched a bit and find a number answers for plain jQuery, asp.net, etc., but not the GM-jQ combo.</p>