title: JQuery .Load() javascript not executing
body: <p>I'm having major problems. I have a page called dashboard.php but the actual page div (ID = #dashboardcontainer) is empty as I am filling the content with this script:</p>
  
  <pre><code>$('#dashboardcontainer').load('functions/pages/dashboard/dashboard_admin.php');
  </code></pre>
  
  <p>then I tried:</p>
  
  <pre><code>$.getScript("assets/plugins/jquery-1.8.2/jquery-1.8.2.min.js", function(){
  $('#dashboardcontainer').load('functions/pages/dashboard/dashboard_admin.php');
  })
  </code></pre>
  
  <p>However, the page I am wanting to "inject" actually has Javascript in it. The problem is, the above javascript's .load() doesn't load the javascript in the file. </p>
  
  <p>I've tried lots of other examples from the following posts but they don't work at all. The javascript isn't actually loading. </p>
  
  <p><a href="https://stackoverflow.com/questions/16352371/jquery-load-ajax-not-executing-javascript-in-returned-html-after-appende">jQuery .load() / .ajax() not executing javascript in returned HTML after appended</a></p>
  
  <pre><code>$.get('partial.html', function(result){
  $result = $(result);
  
  $result.find('#content').appendTo('#new_content');
  $result.find('script').appendTo('#new_content');
  }, 'html');
  </code></pre>
  
  <p>= No javascript firing.</p>
  
  <p><a href="https://stackoverflow.com/questions/1317080/jquery-ajax-load-java-script-not-executing">jQuery ajax load() java script not executing?</a></p>
  
  <pre><code>$("loadStuffHere").load("xyz.html"); $.getScript('js/xyz.js');
  </code></pre>
  
  <p>= Still no javascript firing.</p>
  
  <p>I can't use lots of PHP includes as I receive conflicts which stops my page from rendering correctly. </p>
  
  <p>I've also tried using some sort of Json thing to hide and show dom elements but I hate how complex it is to modify and insert new data. </p>
  
  <p>Is there any simple (this term doesn't seem to exist in the web development dictionary) way I can actually inject a web page that contains it's own javascript in the same way a PHP include would render it? </p>
  
  <p>Here is the PHP page I am trying to inject:</p>
  
  <pre><code>&lt;?php
       echo '&lt;script type="text/javascript"&gt;alert("This is the sub-page");&lt;/script&gt;';
  ?&gt;
  </code></pre>