title: Loading remote JavaScript file in a page
body: <p>I've a simple page in which in the head I load several remote JavaScript files (I need them and can't have a local copy).</p>
  
  <p>The scripts I load are similar to these:</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://mymachine/donald/script1.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://mymachine/donald/script2.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>In the first load of the page I got several error messages regarding objects that are related to these two scripts. So I think the page gets rendered BEFORE the scripts are downloaded and executed. If I try to reload the same page (with the cache loaded with the scripts) I don't get any errors.</p>
  
  <p>However if I try to download each file two times, I don't get any error even if the cache of the browser is clean. I think it is a bad approach but I don't know any alternative.</p>
  
  <p>Is there a tag that permits me to stop the rendering of the page unless the scripts are downloaded? Or an option of the browser? (I don't like this alternative but it could be only one). I need to support only Internet Explorer 7.</p>
  
  <p>I have partially solved using a double loading of the js similar to this one:</p>
  
  <p>but it is correct ?</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://mymachine/donald/script1.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://mymachine/donald/script1.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://mymachine/donald/script2.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://mymachine/donald/script2.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>the libraries are not dependant to each other. In fact if load alternatevly script1 and script2 the errors remains.</p>