by http://webgeektutorials.blogspot.com

Tuesday, July 10, 2012

Reload / Refresh Page in jQuery

Here is the code to refresh the page when u click on a button component. Its just like you press "F5" button to refresh page.
=======================Code begins =========================
<!doctype html>
<html lang="en-us">
<head>
<title>Reload/Refresh a Page in jQuery</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.7.2.js"> </script>

<script type="text/javascript">
$(document).ready(function() {
$('#Refresh').click(function() {
$("p").append("<strong>Now Refreshing page..</strong>");
location.reload();
});
});
</script>
</head>
<body>
<p>Welcome !!</p><br/>

<input id="Refresh" type="Button" value="Refresh" />
</body>
</html>

=======================Code Ends =========================

No comments:

Post a Comment