How can I refresh a page with jQuery?

luca picture luca · Mar 23, 2011 · Viewed 2.6M times · Source

How can I refresh a page with jQuery?

Answer

Roy picture Roy · Mar 23, 2011

Use location.reload():

$('#something').click(function() {
    location.reload();
});

The reload() function takes an optional parameter that can be set to true to force a reload from the server rather than the cache. The parameter defaults to false, so by default the page may reload from the browser's cache.