Re: [XHR] Unespected case

On Wed, 07 Mar 2007 19:07:51 +1100, Diego La Monica <d.lamonica@tosend.it> wrote:

>
> 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?

I think that using the word "ping" is a bad choice, since people who are used to programmin expect it to be related to the ping command, rather than just some local function for keep-alive or similar.

It seems to me that everybody is arguing that the example should do the same thing, and the wording is causing the confusion...

Cheers

Chaals

-- 
  Charles McCathieNevile, Opera Software: Standards Group
  hablo español  -  je parle français  -  jeg lærer norsk
chaals@opera.com          Try Opera 9.1     http://opera.com

Received on Wednesday, 7 March 2007 12:19:18 UTC