title: Javascript file is not excuted after load content with jquery
body: <p>I'd like to load content inside a modal , it works good but there is a javascript file is not displayed after loading content. This is my code:</p>
  
  <p><strong>index.html.twig</strong>
  .
          
           
          </p>
  
  <p>This is the function in <strong>ajax_backend.js</strong> to load content:</p>
  
  <pre><code>$(document).on('show.bs.modal', "#myModal", function (e) {
      // load content inside modal from the link
      var link = $(e.relatedTarget);
      showLoadingDiv();
  
      $(this).load(link.attr("href"), function (responseTxt, statusTxt, xhr) {
          if (statusTxt == "success") {
              collectionInsideModal();
              hideLoadingDiv();
          }
          if (statusTxt == "error")
              alert("Erreur: " + xhr.status + ": " + xhr.statusText);
          hideLoadingDiv();
      });
  
      $(this).on("hidden.bs.modal", function () {
          $(this).html('');
      });
  });
  </code></pre>
  
  <p>after loading the content , the file <strong>nifty.min.js</strong> is not displayed so I must reload this file with the content like this :</p>
  
  <pre><code> &lt;div&gt;
   // content that will be loaded
   &lt;/div&gt;
   &lt;script src="{{ asset('backend/js/nifty.min.js') }}"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>how to fix it to avoid reloading the JS file with content each time ?</p>
  
  <p><strong>This is the the file <a href="https://gist.github.com/houssem04/2973d77b1be2436d6bf4bff916010626" rel="nofollow noreferrer">nifty.min.js</a> not minified</strong></p>