Hi Friends,
I want to display message for every five seonds in Server side using scriplet. For this, i have added below code.
<html>
<head>
<script type="text/javascript">
setInterval(function(){
show();
}, 5000);
function show(){
<%
System.out.println("Five Seconds");
%>
}
</script>
</head>
<body>
</body>
</html>
But it is showing the message "Five Seconds" only once at first time. if we put alert() inside show() method, it displays alert message for every 5 seconds.
i.e.
<script type="text/javascript">
setInterval(function(){
show();
}, 5000);
function show(){
<%
System.out.println("Five Seconds");
%>
}
</script>
I don't now the reason. Please help me.