title: how to call a function of javascript in jsp without any event
body: <p>How can i call a javascript function without any event.
  I have a session variable namely x. what I need is to call a javascript function demo() if the  session variable is not null.</p>
  
  <pre><code> &lt;% if((String)session.getAttribute("x")!=null)
             { %&gt; &lt;script type="text/javascript"&gt; demo(); &lt;/script&gt;
    &lt;% } %&gt;
  </code></pre>
  
  <p>let me know the right way of calling the demo function.</p>