title: Load Javascript file with Javascript based on URL
body: <p>Can I use Javascript to load a Javascript file in HTML based on a string in URL?
  For example something like this:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  if (location.href.indexOf("DEUTCH") != -1) 
      {
      include ('javascript_deutch.js)
      }
      else 
      {
      include ('javascript_english.js)
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>I cannot use any other method like PHP or something.</p>
  
  <hr>
  
  <p>Thanks for the help guys. 
  Unfortunately none of these things seem to work. </p>
  
  <p>This </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  if (location.href.indexOf("DEUTCH") != -1) {
     document.head.innerHTML+='&lt;script src="javascript_deutch.js"&gt;&lt;/script&gt;';
  }else{
     document.head.innerHTML+='&lt;script src="javascript_english.js"&gt;&lt;/script&gt;';
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>ended up just displaying a message at the top of my page: </p>
  
  <pre><code>'; }else{ document.head.innerHTML+=''; } 
  </code></pre>
  
  <p>And this</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  var script = document.createElement('script');
  if (location.path.indexOf("DEUTCH") &gt; -1) {
  script.src = 'javascript_deutch.js';
  } else {
  script.src = 'javascript_english.js';
  }
  document.body.appendChild(script);
  &lt;/script&gt;
  </code></pre>
  
  <p>did not request the files on the server at all.
  Am I missing something?</p>