i have the following request
// =============================================== start()
//
// clicked_button : the user click the start button.
// app_path : the app path
//
// return none.
//
var start = function(clicked_button, app_path) {
$.ajax({
type: 'POST',
data: { 'app_path': app_path },
url: '/app/start',
context: clicked_button,
})
.done(function(data) {
console.log(data);
$(this).removeClass('btn-success');
$(this).addClass('btn-danger');
$(this).text('stop');
})
.fail(function(data) {
console.log('failed to start the app: ' + data);
})
};
the request is sent to the server, and the operation is done completely, i've tested it, the browser receive 200 OK, i've check it, but somehow the code in .done function is not executed, it's like the request is not completed yet.
how can i check if the browser receive a 200 ok, then just abort the ajax call, and continue the jquery code.