After a form is submitted via ajax
, I want to reload the updated page with this jquery:
<p align="left"><button type="submit" class="btn btn-sample btn-md reset send" id="send" name="commit"><b>Save</b></button>
$('.send').click(function(){
location.reload(true);
});
However it doesn't do the reload, unless I click on F5
manually.
Be aware that unless you return false
in the click event handler, the form will be submitted by <button type="submit" />
and you won't be able to see the result of any ajax call due to the page being reloaded
You have to use $.post()
jQuery Method to post form data easily as well as reload the page.
$.post( "test.php",
{ name: "John", time: "2pm" },
function() {window.location.reload(); }
);