Jquery : Refresh/Reload the page on clicking a button
Solution 1:
You should use the location.reload(true)
, which will release the cache for that specific page and force the page to load as a NEW page.
The true
parameter forces the page to release it's cache.
Solution 2:
If your button is loading from an AJAX call, you should use
$(document).on("click", ".delegate_update_success", function(){
location.reload(true);
});
instead of
$( ".delegate_update_success" ).click(function() {
location.reload();
});
Also note the true
parameter for the location.reload
function.
Solution 3:
Use document.location.reload(true)
it will not load page from cache.