title: javascript for ajax pages
body: <p>I just want to clear where should the javascript for the ajax pages should be put in. For example in my page as soon as the page loads i am making an ajax request and retrievn 20 records each consisting of around 10 divs with some buttons and actions of their own.</p>
  
  <p>Now for the ajax and client side js actions for the newly loaded elements the js has to be put inside the callback in the parent function for them to work properly but this is getting messy as i have around 15 actions for the newly loaded controls. </p>
  
  <p>It is quiet easy to put all the code along with the returned ajax page.</p>
  
  <p>THat is if this is what i return from the initial request</p>
  
  <pre><code> &lt;div id="something"&gt;
   &lt;input type="button" id="btn1"&gt;
   &lt;input type="button" id="btn2"&gt;
   &lt;input type="button" id="btn3"&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>If i embed the respective js jquery code for these elements along with the returned result its working fine. </p>
  
  <pre><code> $("#btn1").click(blah)
   $("#btn2").click(blah)
   $("#btn3").click(blah)
  </code></pre>
  
  <p>Question is , is this ok to do it this way. </p>