I’ve got a little jQuery here:
$.ajax({
url: $this.fileUploadUrl,
data: 'url=' + encodeURIComponent(file.name),
type: 'POST',
done: function () {
file.status = plupload.DONE;
$this.updateFileStatus(file);
},
fail: function () {
file.status = plupload.FAILED;
$this.updateFileStatus(file);
}
});
If the server returns a HTTP 500 response, the fail callback does NOT run, and neither does done. I even tried adding always, which didn’t work either. What am I missing?
What are
doneandfail? The documentation does not list them.(They are member functions of the
jqXHRobject, but that’s not the same as them being options in a call to$.ajax().)Perhaps you’re looking for
successanderror, respectively:Or, to keep your original terminology, the following (which is not quite equivalent but close-ish):