title: How to reload all of javascripts after ajax request?
body: <p>I have a page with a lot of javascripts.
  I have content and it has javascript effects. I want to change the content to another content (Of course with the same javascript effects) using ajax.</p>
  
  <p>Here is my code for ajax request:</p>
  
  <pre><code>&lt;head&gt;
  &lt;script type="text/javascript"&gt;
  function ajax(txt) {
      if (window.XMLHttpRequest)
      {
          xmlhttp = new XMLHttpRequest();
      }
      else
      {
          xmlhttp = new ActiveXObject("MICROSOFT.XMLHTTP");
      }
      xmlhttp.onreadystatechange=function()
      {
          if (xmlhttp.readyState==4 &amp; xmlhttp.status==200)
          {
              document.getElementById("content").innerHTML=xmlhttp.responseText;
  
    }
    }
      xmlhttp.open("GET", "index.php?p="+txt, true);
      xmlhttp.send();
  }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="content"&gt;
  ...content...
  &lt;/div&gt;
  &lt;input type="button" onclick=ajax('2') value="click" /&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>The problem is the content is changed but the new content doesn't have any of the javascript effects.
  And I think the javascripts need to be reloaded but how can I do it after an ajax request?</p>
  
  <p>Thanks</p>