$('#submit_id').click(function(){ function mark() { $.ajax({ type: "POST", url: "request1.php", data: $('#form_id').serialize(), cache: false, success: function(data1){ } }); } function other() { $.ajax({ type: "POST", url: "request2.php", data: $('#form_id').serialize(), cache: false, success: function(data2){ } }); } $.when(mark(), other()).done(function(data1, data2) { console.log(data1); $(".results1").html(data1); console.log(data2);
I need to pass the returned data to a type variable:
Console: undefined
source share