2 ajax query that exuces second after first.

2 ajax query that exuces second after first.

how to create 2 ajax request that second one will wait until first finish execution.

$.ajax({
      ...
}).done(function() {
      //here created new thread
      // "then" part start without waiting of "done" part
      uploadObj.startUpload();
}).then(function() {
      ...
});