title: javascript ReferenceError on onclick
body: <pre><code>&lt;html&gt;
      &lt;head&gt;
         &lt;script&gt;
                function view_more(pg_no){
                 alert(pg_no);
                }
         &lt;/script&gt;
     &lt;/head&gt;
    &lt;body&gt;
      &lt;span onClick="view_more('1')"&gt;&lt;/span&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Here, I can't understand why it say always
  [ReferenceError: view_more is not defined]</p>