I have a button which loads after a ajax call , on clicking i want to reload the page (like i press f5)
I tried
$( \".delegate_update_success\" ).click
Use this line simply inside your head with
window.location.reload(true);
It will load your current page or view.
simple way can be -
just href="javascript:location.reload(true);
your answer is
location.reload(true);
Thanks
use window.location.href = url
Use document.location.reload(true) it will not load page from cache.
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.
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.