Core JavaScript

Intermediate JavaScript

JavaScript Reference

JavaScript Refresh Page With Timer Example




How to Auto Refresh Page the page using Javascript, JavaScript Confirm box using to conform after Refresh Page.

JavaScript Refresh Example

Example-Code:

<a href="javascript:location.reload(true)">Refresh this page</a>

Example-Results:

Auto Refresh Example

Example-Code:

<html>
<head>
<script type="text/JavaScript">
function timeRefresh(timeoutPeriod) 
{
	setTimeout("location.reload(true);",timeoutPeriod);
}
</script>
</head>

<body onload="JavaScript:timeRefresh(10000);">

<p>This page is auto referesh in 10 Second after..... please wait 
and see the refresh or not.</p>

</body>
</html>
Online Try This Code Your Self....   »

Example-Results:

Click Here to View Result

Confirm Refresh Example

Example-Code:

<script type="text/javascript" >
function confirm_Refresh() 
{
var Refresh = confirm("Do you want to refresh the page?");
if (Refresh)
	{
		setTimeout("location.reload(true);",5000);
	}
}
</script>

<p>Click Here: 
<a href="javascript:confirm_Refresh();">Refresh This 
Page(5 Second after)</a>
</p>
Online Try This Code Your Self....   »

Example-Results:

Click Here: Refresh This Page(5 Second after)