Php response ajax-php Tutorial

Source: Internet
Author: User
How does php respond to ajax? I use ajax to send a request to the php page... As follows: JScriptcodefunctionrefreshGoodsCat () o processes in php, returns the response content, and sends the response content to ajax. I want to use xmlHttp in ajax. responseText receive ------ solution ------------------ how php responds to ajax on the php page
I used ajax to send a request to the php page... As follows:
JScript code
  Function refreshGoodsCat () o

In php, the response content is returned. how can I send the response content to ajax.
I want to use xmlHttp. responseText to receive

------ Solution --------------------
On the php page, directly echo the xml or json string. after receiving the string, the client parses xml or json. xml can be parsed using the msxml component. json can be downloaded for json2.js parsing. However, I suggest using ajax functions provided by jquery to support multiple browsers, json for php, and json for php.
I have written a small framework similar to. net ICallbackEventHandler. I can send it to you based on jquery and json2.
------ Solution --------------------
The returned content of the corresponding page is as follows:

PHP code
If ($ have) {echo "1"; exit ();

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.