April 10, 2006

W3C is looking at Window, XMLHttpRequest objects

Working drafts for Window, XMLHttpRequest announced

If you ask me, I think it's a Very Good Thing the W3C is looking at these. It harkens back to one of the original purposes of the W3C: creating a standard base for already-existing objects. Having written a JavaScript book before, I believe this should have been done five years ago for Window.

If you're going to offer commentary on these, do bear in mind these are Working Draft documents. In other words, they're about as stable as the Firefox trunk code -- or SeaMonkey trunk, for that matter. ;-) They are not stable specifications, nor should they be used as references. On the other hand, they do accept feedback, and working drafts are put out to the public specifically to seek feedback from consumers.

I'm actually surprised I didn't know about this. I guess I've been getting sloppy. :-)

Posted by WeirdAl at April 10, 2006 10:48 AM
Comments

Well, I try to implement XMLHttpRequest object according to this specification in Java for JavaScript Rhino interpreter.

Frankly, specification is very rough draft, and very serious sections are missing completely:
1. Error handling. Never mentioned in spec. What state should be used for errors? How client should be notified about errors like errors in SSL handshake, timeouts, unexpectedly closed streams and so on (anything besides HTTP errors like 400+ / 500+).
2. Threading and asynchronous loading. Mozilla runs event listener on UI thread, IE runs listener on separate thread (hence a lot of incompatibilities and errors). Hmmmm... And who is right???
3. Re-use of XMLHttpRequest object should be explicitly defined. Now it is quite hard to grasp exact details among open / abort methods description.

Also setRequestHeader that must work as addRequestHeader is just ridiculous naming. If I understand this section in wrong way, then ridiculous wording was used in specification ;)

Valery Silaev
EPAM Systems
http://www.NetWeaverTeam.com

Posted by: Valery Silaev at May 15, 2006 1:26 AM