javascript - How to display returned json using jquery ajax -


this question has answer here:

enter image description here

i have following jquery code:

                    $.ajax({                         type: "post",                         url: "ajax/gettablerecord",                         data:{ : id, t: 'mylist'},                                                 datatype: 'json',                         success: function(data){                             alert(data);                         } 

when activate this, php function gettablerecord, queries db , ends with:

echo json_encode($array); 

i can see correct returned data in console. alert function shows contents of screenshot. how display returned key value pairs in alert box instead?

you can

console.log(data); 

or json.stringify() this

json.stringify(data); 

Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -