I am receiving data in JSON format for name & email by $.ajax() jquery function. I need to put this data in tabular format in a div ('#div1'). I am unable to do this. Can someone help?
JSON received:
[{"jname":"Charles","jemail":"[email protected]"},{"jname":"Bollen","jemail":"[email protected]"},{"jname":"Sita","jemail":"[email protected]"},{"jname":"Lita","jemail":"[email protected]"},{"jname":"Azma","jemail":"[email protected]"},{"jname":"Robert","jemail":"[email protected]"},{"jname":"Charu","jemail":"[email protected]"}]
jQuery Ajax Code:
$.ajax({
type: "POST",
url: "retrieve.php",
data: jQuery("#form1").serialize(),
cache: false,
success: function(data){
$('#div1').html(data);
}
});
Please, help. I need to print this data in tabular form in a div for Name & Email.