Re: [XHR] Unespected case

Denis Sureau:

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

Diego La Monica:
What you write is completelly right Mr. Sureau, but in example 2 of
paragraph 1.1 the working draft cites exactly:
***
If you just want to ping the server with a message you could do something like:

function ping(message) {
 var client = new XMLHttpRequest();
 client.open("POST", "/ping");
 client.send(message);
}
***
The above script is intended ( I suppose) as a System command but
maybe i'm in wrong and is a simple POST message that does not wait for
a respnse. In this case the word ping is not the right one is better
(IMHO): "If you just  want to make stay-up request to the server you
could do something like: .... ".

Dont you think so?


-- 
Diego La Monica
Analista programmatore
Programmazione, Standards ed Accessibilità
Membro: IWA Italy
Via Napoli, 5 - Loc. la Scala
56028 San Miniato (PISA)

tel. (+39) 0571464992
cell. (+39) 3337235382
e-mail: d.lamonica@tosend.it
skype: diego.la.monica
ICQ #: 249-460-264
web: http://dlamonica.netsons.org

Received on Wednesday, 7 March 2007 08:08:11 UTC