Re: [XHR] Unespected case

> client.open("POST", "/ping");

> I suppose that this call cannot works fine. Maybe that on the web server
> root there is a page named simplly "ping", actually if you made the above
> call the response is processed correctly [2] .
> I think that, for a back-compatiblity, you need to provide a different mode
> to make a ping call on the server.
> Or I misunderstand the meaning of the example?


The ping example seems not the best example of what a POST request usually is.
I suggest a more useful request as following, instead:

var xhr = new XMLHttpRequest();
xhr.onreadystatechange=function()
{
if(xhr.readyState == 4)
{
alert("sent " + data);
}
};

xhr.open("POST", "test.php", true);
xhr.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xhr.send("data=" + data);


Denis Sureau - webmaster@xul.fr

Received on Tuesday, 6 March 2007 20:38:54 UTC