JSON and E4X, a path
Manipulating XML with Javascript, when you are using Ajax techniques, is a pain. This is why JSON was created and at first I was pleased with it. It seemed a neat way of passing data back and forth without the hassle of traversing XML nodes.
However it struck me that JSON might be a dead end what with the impending arrival of E4X aka ECMAScript for XML. As the name suggest it makes XML manipulation with Javascript a good deal easier. I haven't worked with it much but as far as I can see it makes XML data a native object in Javascript.
So you can invest in JSON now and then later on switch all your Ajax endpoints to XML and all your client-side script. Or you can battle with XML for now and hope E4X becomes standard in as many browsers as possible.
2 Comments:
Hoping E4X becomes standard across all the major browsers is probably like hoping that you'll never have to write any more browser-specific hacks when doing web design :P
3:34 PM
Though it is one of the least controversial proposals I have seen in years. All the players like XML and E4X does it in a way most people like.
3:41 PM
Post a Comment
<< Home