i am newbie in JSON. i just started learning JSON before 30 mins.
i want to print JSON array in jquery.
$.ajax({
url : '/exp/resp.php',
type : 'POST',
dataType : 'json',
// data : 'uname='+uname+'&pass='+pass,
success : function (data)
{
alert(data);
}
});
now it's printing abc,def,ghi,jkl,mno. so i want to print it separate like abc def ghi etc.. i referred this answer but it didn't help...
Why not print something generic like:
JSON.stringify(data);
This should work with either an object or an array.
if data
is an array then
alert(data.join(' '));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With