Ajax: How does a page receive a two-dimensional array returned by php,

Source: Internet
Author: User
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 );

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.