title: Script in a loaded html with ajax doesn't run
body: <p>I'm having a major problem here and I'm running out of options. I hope someone can help me.</p>
  
  <p>I have a link (script Number 1) that loads a html file (single-project.html) in a div after it is clicked. I'm using jQuery (script Number 2).</p>
  
  <p><strong>But the script number 3, that is in the single-project.html doesn't run.</strong></p>
  
  <p>Here a picture for more clearness</p>
  
  <blockquote>
    <p><img src="https://i.stack.imgur.com/XHISm.jpg" alt="enter image description here"></p>
  </blockquote>
  
  <p><strong>Here the script Number 3, which must fill the div with the id rex</strong> </p>
  
  <pre><code>$('#rex').ready(function() {
      var url="genredetail.php";
      var activitydetail = sessionStorage.activitydetail;
  
      $.getJSON(url,function(json){
          $.each(json.genredetail,function(i,item){
              if(item.name == activitydetail){
                  $('&lt;p class="excerpt"&gt;' + item.beschreibung3 + '&lt;/p&gt;').appendTo('#rex');
              }
          });
      });
  });
  </code></pre>
  
  <p>script Number 2</p>
  
  <pre><code>$('#betriebe').on('click', '.ajax-portfolio', function() {
          var url = $(this).attr("href");
         $('.close-ajaxWrapper').css("background-color","white");
          $('.close-ajax img').tooltip();
          $('html, body').animate({scrollTop: ($('#div1').offset().top - 100)},'slow', function(){
              $('#div1').load(url + ' #transmitter', function (){
                  $('.gallery').slideDown("slow");});
              $('a.close-ajax').click(function(){
                  $('.close-ajax img').tooltip('hide')
                  $('.close-ajaxWrapper').css("background-color","transparent");
                  $('div#filters').slideDown(1000, function(){
                      $('div#div1').empty();
                  });
                  $('html, body').animate({scrollTop: ($('#div1').offset().top - 0)});
  
                  return false;
              });//End: click()
          });
  
          return false;
  
      });
  </code></pre>