title: Executing script in ajax response
body: <p>I load some HTML code into a div with the <code>$.ajax</code> function. but the script that I have in <code>&lt;body&gt;</code> doesn't execute, can you help me please, it's very important for me.</p>
  
  <p><a href="https://i.stack.imgur.com/9LRfa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9LRfa.png" alt="enter image description here"></a></p>
  
  <p>This is my HTML main page:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Navigation AJAX avec jQuery&lt;/title&gt;
  
  &lt;script type="text/javascript" src="js/jquery.js"&gt;&lt;/script&gt;
    
  &lt;script type="text/javascript"&gt;
  $(document).ready(function() {
   var $contenu_div = $('#content div');
   
   
   $('#nav li a').on('click', function() {
    var url = $(this).attr('href'); 
  
     $.ajax({
      url: url,
      cache: false,
      success: function(html) {
       $contenu_div.hide().html(html).fadeIn();
      }
     });
      
    return false;
   });
  });
  &lt;/script&gt;
    
  &lt;/head&gt;
  &lt;body&gt;
  
   &lt;h2&gt;Navigation AJAX with jQuery&lt;/h2&gt;
  
   &lt;div id="menu"&gt;
    &lt;ul id="nav"&gt;
     &lt;li&gt;&lt;a href="pages/page1.html"&gt;page 1&lt;/a&gt;&lt;/li&gt;
     &lt;li&gt;&lt;a href="pages/page2.html"&gt;page 2&lt;/a&gt;&lt;/li&gt;
     &lt;li&gt;&lt;a href="pages/page3.html"&gt;page 3&lt;/a&gt;&lt;/li&gt;
     &lt;li&gt;&lt;a href="pages/page4.html"&gt;page 4&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
   &lt;/div&gt;
  
   &lt;div id="content"&gt;
    &lt;div&gt;the content of the first page&lt;/div&gt;
   &lt;/div&gt;
    
    &lt;script src="problem.js"&gt;&lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>I have simplified the code</p>
  
  <p>The ajax navigation work perfectly but the <code>&lt;script src="problem.js"&gt;&lt;/script&gt;</code> doesn't execute, what is the problem?</p>