i have some code and request from multiple url, and result data is array , if i use result.push(data) the result will give [[{Data1:a,Data2:b}],[{Data1:c,Data2:d}]] how to merged data become array like [{Data1:a,Data2:b},{Data1:c,Data2:d}]
var url_api = [<?=$urlapi;?>];
var responses = [];
for(var i = 0; i < url_api.length; i++){
getTarif(url_api[i]);
}
function getTarif(link){
$.ajax({
type: 'GET',
url: link,
dataType: 'json',
error: function () {
alert('Unable to load url :'+link+', Incorrect path or invalid url');
},
success: function (data) {
responses.push(data.data);
}
});
}