mardi 17 février 2015

$.post .done callback not firing but data gets posted to server


I have a simple javascript where I am POSTing to a server some data.



$.post(url,dataJSON, function() {
}).done(function(json) {
$("#summary-modal").modal('hide');
}).fail(function(xhr, status, error) {
var err = "<div>"+xhr.responseText+"</div>";
$('#submit_err').append(err);
$('#submit_err').show();
});


Now for some odd reason once the POST has been sent to the server and been accepted, it doesn't go the .done function. So in this case the modal doesn't hide.


Any ideas what might be wrong?


Thank you for reading.





Aucun commentaire:

Enregistrer un commentaire