$.ajax('s done not called

$.ajax('s done not called


Hi,

I have below simple ajax call to post a form. the form is being successfully posted and data were saved to the database but the problem here is my done is never been invoked and i am not getting the console.log("done") nor the rest of the done code.

where is the issue here please?

  1. $.ajax({
  2. method: "POST",
  3. url: "save_student.php",
  4. data: $("#frmNewStudent").serialize(),
  5. dataType: "JSON",
  6. beforeSend: function()
  7. {
  8.      $("#ButtonSaveNewStudent").hide();
  9.      $("#ImageLoading").show();
  10. }
  11. }).done(function(data)
  12. {
  13.     console.log("done");
  14.     console.log(data);
  15.     window.location.replace('my_kids.php');
  16. });


Thanks,
Jassim