title: $(document).ready() doesn't run after f:ajax rendering
body: <p>I have some <code>jQuery</code> code that runs on every <code>$(document).ready()</code> event.
  I also have some <code>&lt;f:ajax&gt;</code> tags that do re-rendering of some parts of the page.</p>
  
  <p>I noticed that when I rerender a component, the <code>$(document).ready()</code> doesn't get called.</p>
  
  <p>Is there a way to run javascript code after every <code>&lt;f:ajax&gt;</code> rerendering?
  (I can technically use the <code>onevent</code> tag but that's the unfavourable solution to me since I will have to call the function on every <code>&lt;f:ajax&gt;</code>)</p>
  
  <p><em>Just for illustration, this is the jQuery Code:</em></p>
  
  <pre><code>$(document).ready(function() { ...CODE... }
  </code></pre>
  
  <p><em>And the JSF code:</em></p>
  
  <pre><code>&lt;f:ajax event="click" render=":someComponentID"/&gt;
  </code></pre>
  
  <p>Thanks!</p>
  
  <p><strong>UPDATE</strong> This question might be a duplicate of <a href="https://stackoverflow.com/questions/5719336/jsf2-execute-javascript-after-every-postback">this one</a>. I'm looking into it.</p>
  
  <p><strong>UPDATE2</strong>
  This is easily solvable using the JSF Javascript event binding:</p>
  
  <pre><code>jsf.ajax.addOnEvent(function(data){
    if (data.status === 'success') {
      // Do stuff here
    }
  }
  </code></pre>
  
  <p>Read more about it under the JSF 2 reference</p>