|
Posted by Rasmus Lerdorf on 07/23/05 18:43
Chris Boget wrote:
>>function sndReq(action) {
>> http.open('get', 'rpc.php?action='+action);
>> http.onreadystatechange = handleResponse;
>> http.send(null);
>>}
>
>
> So with AJAX, the data gets sent back to the browser using GET?
> Is there any way you can do it using POST?
The prototype for the http.open method looks like this:
open("method","URL",async,"uname","pswd")
So to do a POST request instead, just use 'post' instead of 'get' in the
first argument. Then put the url encoded post data in the http.send() call.
-Rasmus
Navigation:
[Reply to this message]
|