W3C home > Mailing lists > Public > public-webapi@w3.org > March 2007

Re: [XHR] Unespected case

From: Diego La Monica <d.lamonica@tosend.it>
Date: Wed, 7 Mar 2007 09:07:51 +0100
Message-ID: <e4cd4de70703070007y405ccbb3g481ffef70b59e0d9@mail.gmail.com>
To: public-webapi@w3.org

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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:16:23 UTC