title: Why does my js not display anything?
body: <p>I was wondering why does my js script not working properly when I call from external file in html</p>
  
  <p>here is my js code</p>
  
  <pre><code>&lt;script&gt;
  
  var interval=2000;
  function toJson(){
      document.writeln("json file");
  }
  function toCsv(){
      document.writeln("csv file");
  }
  
  
  function process(){
      toJson();
      tocsv();
  }
  process();
  setInterval(process,interval);
  
  function terminate(){
  
      var timer=setInterval(process,interval);
      clearInterval(timer);
  }
  
  &lt;/script&gt;
  </code></pre>
  
  <p>and here is index.html</p>
  
  <pre><code>&lt;html&gt;
  &lt;title&gt;Test Javascript&lt;/title&gt;
  &lt;head&gt;&lt;script language="javascript" src="js/myscript.js"&gt;&lt;/head&gt;
  &lt;body&gt;
  &lt;h1&gt;Test&lt;/h1&gt;
  &lt;fieldset&gt;
  &lt;legend&gt;test javascript form&lt;/legend&gt;
  &lt;form&gt;
  &lt;input type="submit" onclick="process()" value="process"&gt;
  &lt;input type="submit" onclick="terminate()" value="terminate"&gt;
  &lt;/form&gt;
  &lt;/fieldset&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>when I run it, I don't know why does it not display anything</p>
  
  <p>How do I solve this issue?</p>