On Tue, 06 Mar 2007 23:23:20 +0100, Geoffrey Garen <[EMAIL PROTECTED]> wrote:
I would like to suggest making the canonical readyState values available as named constants of the XMLHttpRequest constructor, like so

      0 UninitializedReadyState
      1 OpenReadyState
      2 SentReadyState
      3 ReceivingReadyState
      4 LoadedReadyState

This code

      if (request.readyState == XMLHttpRequest.OpenReadyState) { ... }

is more readable to me that this code

      if (request.readyState == 1) { ... }

which uses a magic number. The DOM 3 APIs tend to use named constants like this.

Some initial drafts used to have this and it was removed because of comments, iirc, from Maciej among other people. If enough authors and implementors support this idea though I suppose we can reconsider that. Anyone?


--
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>

Reply via email to