title: Javascript code to detect any page changes? (maybe via AJAX)
body: <p>I'm new to writing Javascript, and here's what I'm doing/trying to do.</p>
  <p>When a page loads (<code>window.onload</code>) my Javascript code goes through all the forms in a page and attaches a certain <code>onchange</code> method to them. This works fine for most websites on the internet, except when a page dynamically updates to load more forms on the page. How do I detect such an event and re-run my function?</p>
  <p>For example:</p>
  <p>The Facebook Newsfeed has a bunch of forms associated with all the different statuses/links posted. My code goes through them and attaches the listener. But if go you all the way down the page automatically updates to reveal more statuses/links/etc. (or you click the &quot;Older Posts&quot; link) - but now my javascript code has not run globally again.</p>
  <p>Anyway I can do that?</p>
  <p>EDIT: I am writing a browser extension.</p>