I suddenly started getting the following:
TypeError: $.ajax(...).done(...).fail(...).complete is not a function
My code:
this.sendRequest = function (type, extension, data, successCallback, successMsg, failMsg, failCallback) {
var self = this;
var options = {
url: self.baseUrl + self.apiEndpoint + extension,
type: type,
dataType: 'json',
xhrFields: {
withCredentials: true
}
};
if (data != null) {
options.data = data;
}
return $.ajax(options)
.done(function (response) {
// do stuff
})
.fail(function (response) {
// do stuff
}).complete(function (response) {
// do stuff
});
};
Why is this happening? I did update jQuery - did some of this syntax become invalidated?