Friday, June 18, 2010

Javascript function to Refresh the page every one minute

In jsp include the javascript file in the following way

<script type='text/javascript' src="<%=request.getContextPath()%>/user/javascript/refreshdetails.js"></script>
<script type="text/javascript">
window.setInterval("refresh()",60000);
</script>

In refreshdetails.js file write the following function

function refresh(){
location.reload(true);
}

This will refreshes the page for every 1 minute

No comments:

Post a Comment