error:function(response)
{
alert("e"+typeof response+" "+Object.keys(response).length+" "+" "+response.txt);
} /*use console.log*/
This is my error callback function in ajax post method.
I am returning data from php as follows
die('{"status":0,"txt":"Email Already Exists"}');
It is valid json and i checked with jsonlint. [But i have doubt with this die statement validity too]
I am getting the alert as follows
eobject 21 undefined
Yes, It is JSON Object. 21 characters are totally in the keys[Not sure whether my assumption is correct]. But how response.txt is undefined. If i print response it says object object.
But i din't see any response in Net tab of chrome under my php file. Actually ajax callback is in my html page. die code is from my php page.
Please correct me if i am wrong.How to get my JSON values.
Aucun commentaire:
Enregistrer un commentaire