title: Calling a function from one JavaScript file which requires another
body: <p>I am trying to call a function written in one JavaScript file from another JavaScript file. I have the following code, but it doesn't work:</p>
  
  <h3>My HTML file</h3>
  
  <pre><code>&lt;script type="text/javascript" src="js1.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="js2.js"&gt;&lt;/script&gt;
  &lt;script language="javascript"&gt;
      js1();
  &lt;/script&gt;
  </code></pre>
  
  <h3>js1.js</h3>
  
  <pre><code>function js1()
  {
      alert("Hello from js1");
      js2();
  }
  </code></pre>
  
  <h3>js2.js</h3>
  
  <pre><code>function js2() 
  {
      alert("Hello from js2");
  }
  </code></pre>
  
  <p>What can I do?</p>