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.
<% if((String)session.getAttribute("x")!=null)
{ %> <script type="text/javascript"> demo(); </script>
<% } %>
let me know the right way of calling the demo function.