title: Unable to call function from external JavaScript
body: <p>I have a simple HTML page which calls a JavaScript function:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;script type="text/javascript" src="css/myscript.js"&gt;&lt;/script&gt;
      &lt;head&gt;
          &lt;link rel="stylesheet" href="css/style.css"&gt;
      &lt;/head&gt;
      &lt;body onload="javascript:hello()"&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>This is my <code>hello()</code> function:</p>
  
  <pre><code>&lt;script&gt;
  function hello() {
      alert("load new content");
      document.open();
      document.write("&lt;h1&gt;Changed content!&lt;/h1&gt;");
      document.close();
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>When pasting the JavaScript block into the page directly, it works. However it's not able to find <code>hello()</code> if the JavaScript is contained within a dedicated file.</p>
  
  <p>Using the Developer tools I can see that the JavaScript file is loaded successfully.</p>