Ajax: How does the page receive the two-dimensional array returned by php !!! I used ajax to request a php file. in the php file, the json_encode () function is used to format the returned two-dimensional array. javascript uses xmlHttp. responseText receives the message, but it seems that it cannot be used as a two-dimensional array. does it need to be converted into an Object type ?, Receiving ajax: How does the page receive two-dimensional arrays returned by php? hurry !!!
I used ajax to request a php,
In the php file, use the json_encode () function to format the two-dimensional array returned,
Javascript is received using xmlHttp. responseText, but it does not seem to be possible
As a two-dimensional array application, does it still need to be converted to the Object type?
------ Solution --------------------
After receiving the request, you must use JavaScript eval for processing, which is the Json object.
As shown below.
JScript code
Var obj_json = eval (xmlHttp. responseText); alert (obj_json.id );