top_menu

Sunday, 5 August 2012

How to refresh a page using jQuery?

.

To refresh or reload a page with jQuery, you can use the “location.reload();” command.

<html>
<head>
<title>Refresh a page using jQuery</title>
 
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
 
</head>
 
<body>
 
<button id="PageRefresh">Refresh a Page using jQuery</button>
 
<script type="text/javascript">
 
$(function(){
 $('#PageRefresh').click(function() {
 
           location.reload();
 
 });
 });
</script>
 
</body>
</html>