title: Pass a GET parameter to a JavaScript function?
body: <p>I have this code</p>
  
  <pre><code>&lt;%=out.write("&lt;input 
    type=\"hidden\" 
    id=\"tid\" 
    value=\""+request.getParameter("id").toString()+"
  \"/&gt;")%&gt;
  &lt;script type="text/javascript"&gt;
    getPage(document.getElementById("tid").value)
  &lt;/script&gt;
  </code></pre>
  
  <p>This code creates a hidden field with the value came from </p>
  
  <p><code>&lt;site root&gt;/viewPage.jsp?id=erwdf</code></p>
  
  <p>url and pass the value of this hidden field to a jsp function. When I ran this code on Tomcat it gave an error as</p>
  
  <blockquote>
    <p>The method print(boolean) in the type JspWriter is not applicable for
    the arguments (void)</p>
  </blockquote>
  
  <p>on JSP code line I given above. So am I doing anything wrong or is there any alternative method to pass a GET parameter to a JavaScript function? I don't know much about Javascript just started to learn it.</p>