I have a php file which contains only JSON data(print_r($json)).I want to return this JSON data in AJAX success function.All the questions and tutorials are about a specific data returning,so I can't find a solution for having a return of all JSON data: Here's the code(in jQuery):
$.ajax({
type : 'POST',
url : 'https://example.com/api',
contentType: 'application/json',
data : json,
dataType: 'json',
success: function(data){
/////$("body > .container").html(html);
///// var data = JSON.parse(html.data);
//// alert(data[0]);
//// var json = $.parseJSON(data);
//// alert(json.html);
}
})