title: jQuery append will download external src in script tags, but won't load into DOM
body: <p>If I include a script with an external source and then try to parse using jQuery - it will download the script, but won't load it into the DOM.  I'm using using <a href="http://api.jquery.com/append/" rel="nofollow noreferrer"><code>.append()</code></a>, but this seems to be the case for any other jQuery DOM insertion method.</p>
  
  <h3>Here's an example in Stack Snippets</h3>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(function(){
    
    var selet2Html =
      '&lt;link href="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/css/select2.css" rel="stylesheet"/&gt;' +
      '&lt;script src="//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/js/select2.js" &gt;&lt;\/script&gt;' +
      '&lt;select class="select2"&gt;' +
      '  &lt;option value="AK"&gt;Alaska&lt;/option&gt;' +
      '  &lt;option value="HI"&gt;Hawaii&lt;/option&gt;' +
      '&lt;/select&gt;' +
      '&lt;script &gt;' +
      '  $(function() {' +
      '    $(".select2").select2();' +
      '  });' +
      '&lt;\/script&gt;';
      
    $("body").append(selet2Html);
    
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js"&gt;&lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Even though this will download the script in the network tab:</p>
  
  <p><img src="https://i.imgur.com/BlcxVQi.png" alt="Network Activity"></p>
  
  <p>It will still return the following error (indicating that the external library - select2 - never loaded):</p>
  
  <p><img src="https://i.imgur.com/gQmwIA6.png" alt="Uncaught TypeError: $(...).select2 is not a function"></p>
  
  <p>I'd prefer not to use <a href="https://api.jquery.com/jquery.getscript/" rel="nofollow noreferrer"><code>$.getScript()</code></a> as I'm actually loading this string dynamically with <a href="http://api.jquery.com/load/" rel="nofollow noreferrer"><code>.load()</code></a>, so I'm not sure if it's going to contain any external scripts or not.</p>
  
  <p>How can I get it to load the external library?</p>