…and why not!?

I am sure I am not the first person to have run into this in my Javascript adventures. The generous individuals that created the Taconite framework probably wrestled with this issue, and I am sure there are others.

But can someone, please, tell me why, I can’t take issue an XMLHttpReqest, get text/xml back, take a snippet from that response and appendChild/replaceChild/etc.

The current solution is to get xml (yes yes RF, a string representation of xml), then loop through all the nodes, grab the tag name, then do a document.createElement. Is it just me or is that just plain inefficient? Lets see here, I have a response string that is magically transformed in a DOM fragment by the XMLHttpRequest, then I have to re-parse that DOM into another DOM, because why again?

Alot of people bellyache about how innerHTML isn’t in any spec, which it isn’t, but then they jump through every hoop imaginable causing a ton of overhead and complication to get around not using it. But even so in order to use innerHTML I have to serialize my text/xml response into a string. So there is more overhead there. I am with others that when someone blames the complier for errors to raise more than the curious eyebrow, but this seems like something is definitely broke.

Comments are closed.