I am displaying server time
on a jsp
page, and in order to display correct time, I have to call that jsp
page to refresh the displayed time which leads to many requests
to the server
.
Can anyone suggest any improvement on the way I'm displaying server time on jsp
page without sending request
frequently?
function displayserver(){
$.post("DisplayServerTime.jsp","",function(data,status, req){
$("#DisplayTimeSection").text(req.responseText.trim());
});
}
$(function(){
setInterval(
function(){
displayserver();
}
, 30000);
});