For example if I do this request with jQuery’s Ajax:
$(document).ready(function() {
$('#some_button').click(function() {
$.ajax({
url: '/some/request',
type: 'POST',
data: [{my: 'dummy', data: 'lata'}],
dataType: 'json',
async: true,
});
window.location.href = '/my/parent/location';
});
});
So I’m interested:
Will my action be completed on the server nevermind if I’m refreshing the page just right after the initial request is sent?
Ajax is synchronous.. So it will be immediately redirected irrespective of the Request..
You can call that in the success callback of your
Ajax Requestinstead..