Sourabh Dhiman

Sourabh Dhiman

  • NA
  • 323
  • 53.2k

function call sequential using jquery ?

Oct 14 2019 5:33 AM
function savedata() {
$.ajax({
url: 'http://localhost:29761/api/Value',
type: 'POST',
dataType: 'json',
success: function (data, textStatus, xhr) {
console.log(data);
//deferred.resolve(data);
},
error: function (xhr, textStatus, errorThrown) {
console.log('Error in Operation');
}
});
//return savedata();
}
function DelData() {
$.ajax({
url: 'http://localhost:29761/api/Value',
type: 'DELETE',
dataType: 'json',
success: function (data, textStatus, xhr) {
console.log(data);
},
error: function (xhr, textStatus, errorThrown) {
console.log('Error in Operation');
}
});
//return DelData();
}
function firstfunction() {
$.ajax({
url: 'http://localhost:29761/api/Value',
type: 'GET',
dataType: 'json',
(data, textStatus, xhr) {
console.log(data);
},
error: function (xhr, textStatus, errorThrown) {
console.log('a' + textStatus);
}
});
This is my code . How to call all this function in sequence using jqury . I will using .when() function but not run . Please my help .

Answers (2)