title: How do I dynamically change javascript library if it is not found whilst loading the DOM?
body: <p>I have an HTML page which calls a few javascript libraries using the "script" tag.</p>
  
  <p>One of these is actually provided by another server which occasionally crashes and thus reports a "STATUS 404 NOT FOUND".</p>
  
  <p>The advantage of using this server is that it is faster than mine and loads the libary in about 200 miliseconds whereas when it is on my server is takes about 2 seconds. However, I would like to keep a copy on my server and only load it when the browser reports a Status 404.</p>
  
  <p>But how do I program that in javascript?</p>
  
  <pre><code>function LoadLib(){
  
  if (server status == 404)
      {load library 1} 
  else
      {load library 2}
  }
  </code></pre>
  
  <p>Something along these lines?</p>
  
  <p>Anyone done this before?</p>