title: Executing a JavaScript file directly from the browser
body: <p>This sounds like a trivia question but I really need to know.</p>
  
  <p>If you put the URL of an HTML file in the Location bar of your browser, it will render that HTML.  That's the whole purpose of a browser.</p>
  
  <p>If you give it a JPG, or a SWF, or even PDF, it will do the right things for those datatypes.</p>
  
  <p>But, if you give it the URL of a JavaScript file, it will <em>display</em> the text of that file.  What I want is for that file to be executed directly.</p>
  
  <p>Now, I know that if you use the <code>javascript:</code> protocol, it will execute the <em>text</em> of the URL, but that isn't what I need.</p>
  
  <p>I could have the URL point to an HTML file consisting of a single <code>&lt;script&gt;</code> tag that in turn points to the JavaScript file, but for occult reasons of my own, I cannot do that.</p>
  
  <p>If the file at <code>http://example.com/file.js</code> consists entirely of</p>
  
  <pre><code> alert("it ran");
  </code></pre>
  
  <p>And I put that URL in the Location bar, I want "it ran" to pop up as an alert.</p>
  
  <p>I'm skeptical that this is possible but I'm hoping-against-hope that there is a header or a MIME type or something like that that I can set and miraculously make this happen.</p>