title: Ajax - Jquery and Javascript not loading when ajax content is loaded
body: <p>I am loading an external HTML file with ajax. This content needs Javascript and Jquery to run. When the content loads it is not running correctly. Everything works fine if the content is all on the page without loading.</p>
  
  <p>Here is my Jquery/Ajax that loads content.</p>
  
  <p>The script is not placed in the head, i placed it above my the div that needs to load content.</p>
  
  <pre><code> &lt;script language="javascript"&gt;
  function example_ajax_request() {
    $('#bottom_content').html('&lt;p&gt;&lt;img src="ajax-loader.gif" width="32" height="32" /&gt;&lt;/p&gt;');
    setTimeout('example_ajax_request_go()', 2000);
  }
  function example_ajax_request_go() {
      $("#bottom_content")
          .hide()
          .load('bottom.html', function(){
          alert($(this).find('script').length)
              $(this)
                  .fadeIn(2000)
                  .find('script').appendTo('head');
          });
  }
  $(document).ready(function() {
     example_ajax_request();
  });
  
  &lt;/script&gt;
    &lt;div style="position:absolute; left: 44%; margin-left: -450px; top: -100px; background-image:url(images/AG_V4_bottom_section_back.png); width: 1126px; height: 296px; z-index: 5000;"&gt;
     &lt;div id="bottom_content" style="width:1125px; height: 296px;"&gt;&lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>Here is the jquery. </p>
  
  
  
  <p>It is loading into a div id called bottom_content.</p>
  
  <p>I tried looking at getscript, .live, .on, ajaxcomplete but I just can't seem to put it all together.</p>
  
  <p>Any help would be welcome.</p>
  
  <p>Guzz</p>
  
  <hr>
  
  <p>bottom.html code</p>
  
  <pre><code>&lt;div style="width: 370px; height: 45px; padding-left: 30px; float:left;"&gt;NEWS&lt;/div&gt;
    &lt;div style="width: 340px; height: 45px; padding-left: 30px; float:left;"&gt;FEATURED PROJECT&lt;/div&gt;
    &lt;div style="width: 310px; height: 45px; padding-left: 30px; float:left;"&gt;FEATURED PROJECT&lt;/div&gt;
    &lt;div class="percentagewrap" style="width: 400px; float:left; margin-right: 2px;"&gt;
      &lt;div id='mycustomscroll2' class='flexcroll'&gt;
        &lt;div style="width: 325px; margin: auto; text-align:left;" class="white_text01"&gt; &lt;strong&gt;6-27-12&lt;/strong&gt;&lt;br /&gt;
          I made some changes to the site. I changes the backgrounds of each page. I hope you like them! &lt;br /&gt;
          &lt;br /&gt;
          &lt;strong&gt;3-20-12&lt;/strong&gt; &lt;br /&gt;
          I would like to welcome you to the launch of AndrewGuzman.com version 3. I have redesigned everything from scratch and I have included some of my 3D work. I am currently upgrading my 3D skills so stay tuned to the site for more 3D content. And of course, I have my Web, Logo and Print sections as well. I would love to hear what you think about my site so send me your thoughts on my contact page. Thanks and Enjoy. &lt;br /&gt;
          &lt;br /&gt;
          &lt;strong&gt;10-10-11&lt;/strong&gt; &lt;br /&gt;
          3D Animation Content is coming soon I have been very hard at work on some intensive 3Ds Max training. Will have some 3D designs for the site around the X-mas holiday. I am very excited to show everyone what I have been doing. &lt;br /&gt;
          &lt;br /&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div style="float: left; width: 365px; height: 210px;"&gt;&lt;div style="width: 293px; margin: auto;"&gt;&lt;img src="images/featured_image.jpg" width="293" height="184" vspace="4" border="0" /&gt;
    &lt;div style="height: 30px; width: 100%;"&gt;&lt;div class="white_text01" style="margin: auto; width: 250px;"&gt;David-Alan-Hughes.com   | View Project&lt;/div&gt;&lt;/div&gt;
    &lt;/div&gt;
    &lt;/div&gt;
  
    &lt;div style="float: left; width: 340px; height: 210px;"&gt;
  &lt;div id="contact_form"&gt;
    &lt;form name="contact" method="post" action=""&gt;
      &lt;fieldset&gt;
        &lt;label for="name" id="name_label"&gt;Name&lt;/label&gt;
        &lt;input type="text" name="name" id="name" size="30" value="" class="text-input" /&gt;
        &lt;label class="error" for="name" id="name_error"&gt;This field is required.&lt;/label&gt;
  
        &lt;label for="email" id="email_label"&gt;Return Email&lt;/label&gt;
        &lt;input type="text" name="email" id="email" size="30" value="" class="text-input" /&gt;
        &lt;label class="error" for="email" id="email_error"&gt;This field is required.&lt;/label&gt;
  
        &lt;label for="phone" id="phone_label"&gt;Return Phone&lt;/label&gt;
        &lt;input type="text" name="phone" id="phone" size="30" value="" class="text-input" /&gt;
        &lt;label class="error" for="phone" id="phone_error"&gt;This field is required.&lt;/label&gt;
  
          &lt;br /&gt;
        &lt;input type="submit" name="submit" class="button" id="submit_btn" value="Send" /&gt;
      &lt;/fieldset&gt;
    &lt;/form&gt;
  &lt;/div&gt;
  
    &lt;/div&gt;
  </code></pre>
  
  <hr>
  
  <p>Scripts in head</p>
  
  <pre><code>&lt;!-- news scroller--&gt;
      &lt;link href="css/tutorsty.css" rel="stylesheet" type="text/css" /&gt;
  &lt;link href="css/flexcrollstyles.css" rel="stylesheet" type="text/css" /&gt;
  &lt;script type='text/javascript' src="js/flexcroll.js"&gt;&lt;/script&gt;
  
  
  &lt;!-- slider--&gt;
  &lt;script src="js/modernizr-2.6.1.min.js"&gt;&lt;/script&gt;
      &lt;script src="js/jquery-1.2.3.pack.js"&gt;&lt;/script&gt;
      &lt;script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.9.0.min.js"&gt;&lt;/script&gt;
  
  
  &lt;script type="text/javascript"&gt;
  jQuery.noConflict();
  &lt;/script&gt;
      &lt;script src="js/lean-slider.js"&gt;&lt;/script&gt;
  
    &lt;link rel="stylesheet" href="css/lean-slider.css" type="text/css" /&gt;
      &lt;link rel="stylesheet" href="css/sample-styles.css" type="text/css" /&gt;
  
  &lt;!-- ajax jquery contact form--&gt;
  
  
  
  &lt;script src="js/runonload.js"&gt;&lt;/script&gt;
  &lt;script src="js/tutorial.js"&gt;&lt;/script&gt;
  &lt;link href="css/tutorial.css" media="all" type="text/css" rel="stylesheet"&gt;
  </code></pre>