I am having trouble with my jquery script below, this is a basic stripped down version and even it will not work, I have the php file that the jquery script makes a call to, I have it set to encode and show a json response
Then in the jquery script it should read the value and respond to it but It is not getting the response.
Is json.response the wrong way to call a variable in the json string that is name response?
Can someone help please I am stuck
'error','comment'=>'test comment here');
echo json_encode($arr);
?>
//the script above returns this:
{"response":"error","comment":"test comment here"}
UPDATE;
I have changed
json.response
into
data.response
But this did not make it ork either
以上就是How to get jSON response into variable from a jquery script的详细内容,更多请关注web前端其它相关文章!