jQuery.ajax({ type: "GET", url: 'http://ayambrand-com-my-v1.cloudaccess.host/index.php?option=com_echarity&format=raw&task=api.get_need&charity_id=' + ID, success: function (data){ var ac = JSON.parse(data); var content = '
' + 'Product' + ' | ' + '' + 'Quantity Need' + ' | ' + '' + 'Price Each' + ' | ' + '' + 'My Donation' + ' | ' + '' + 'Amount' + ' | '; jQuery.each(ac, function(index, value) { jQuery.each(value.unmet_quotas, function(subindex, subvalue) { jQuery.each(subvalue, function(subsubindex, subsubvalue){ remaining_quota = subvalue.remaining_quota; product_id = subvalue.product_id; quota = subvalue.quota; console.log('Product ID : ' + product_id +' Quota : ' + quota + ' Remaining Quota : ' + remaining_quota); }); datas += "
---|---|---|---|---|
' + '{"product"}' + product_id + '{"/product"}' + ' | ' + '' + remaining_quota + ' | ' ; datas += "