title: not able to call Javascript Function from button onclick
body: <p>I have following JS Code. When test.php is loaded and I click on button show function is not getting called.I am trying this on FF. Any suggestions what is wrong here.</p>
  
  <p>test.php</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://localhost/test1.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="http://localhost/test2.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>test1.js</p>
  
  <pre><code>function show()
  {
      alert("hello");
  }
  </code></pre>
  
  <p>test2.js</p>
  
  <pre><code>      function showHTML()
          {
          var html = "&lt;!DOCTYPE html&gt;";
          html += "&lt;html&gt;&lt;body&gt;";
          html += "&lt;input type='button' name='button'  style='width:100px;height:50px;' onclick='show();' /&gt;";
          html += "&lt;/body&gt;&lt;/html&gt;";
          document.write(html);
          }
  
  window.addEventListener("load", function() {
        alert("eevnet");
        showHTML();
      }, false);
  </code></pre>