Wednesday 23 November 2011

Refreshing / Reloading the page through Java Script

1)   To Refreshing page through Get request

<input type="button" value="Reload Page"
onClick="window.location.href=window.location.href">

2)  To Refreshing page through last request (Get or Post)

  <input type="button" value="Reload Page" onClick="window.location.reload()">

3) To reload page through browser cache 


<input type="button" value="Reload Page" onClick="history.go(0)">

4) To Refreshing Periodically

function refreshPeriodic()
{
location.reload();
timerID=setTimeout("refreshPeriodic()",30000);
}
timerID=setTimeout("refreshPeriodic()",30000);

No comments:

Post a Comment