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 ();