How to refresh a page in jQuery?
Published: May 10, 2010 , Updated: May 5, 2010 , Author: mkyong
To refresh or reload a page with jQuery, you can use the “location.reload();” command.
<html> <head> <title>Refresh a page in jQuery</title> <script type="text/javascript" src="jquery-1.3.2.min.js"></script> </head> <body> <button id="PageRefresh">Refresh a Page in jQuery</button> <script type="text/javascript"> $('#PageRefresh').click(function() { location.reload(); }); </script> </body> </html>
Note : You can find more similar articles at - jQuery Tutorials








[...] Taken from : http://www.mkyong.com/jquery/how-to-refresh-a-page-in-jquery/ [...]
I wold like to load only particular div. please help me out.
Thanks in advance.
refresh will call ready function again, so use below ready function and do db get again in the place of below alert statement like below :
$(document).ready(function(){
$(“#divIdHere”).html(“Your greeting message”);
alert(‘get db content here’);
});
That’s not jQuery; it’s plain old JavaScript. It’s like saying that you can bring up a calculator in Word by clicking the Windows Start button and typing ‘calc’.
JQuery is based on js, i second mk yong in showing how js can be called using query.
thanks for the post, useful
Hello, cool post =D
Guy I’ve got a problem, really huge problem, I load some content from database into a div, it’s an Welcome message, but when I click the refresh button it’s all gone, how can I solve this problem??
refresh calls ready function, use ur db get there in ready function
[...] Page refresh with jQuery Refresh a page with jQuery location.reload(); [...]