Ajaxing a Problem

Yesterday, I put the first AJAX function into the code. On the positive side, there are so many good examples, now, that setting up Ajax was pretty easy.

I think I’ve been persuaded by articules like this one that suggest that, although XML is nice, it’s sometimes overkill. Transmitting XML over the AJAX request sort of requires some JavaScript to render the XML on the client side. That can be a lot of JavaScript, especially for the problem we were working on.

Also, we’d invested a bit of effort into an HTML rendering framework that handled a lot of hard problems, and I didn’t want to reproduce those solutions in JavaScript.

So I transmitted an HTML snippet in my asynchronous request. My server is now responsible for all rendering decisions, and it knows how to format my data for display.

Using a JavaScript node property — innerHTML — I could swap the HTML under a particular node with another HTML snippet. That was great, until I found this limitation. Of course, I discovered this fairly late in the game because I did all of my initial developer testing in Firefox.

Okay, so that’s my bad (since our user group is using IE, and that’s the key browser we have to support), but why, oh why, is Internet Explorer so difficult to use?

Anyway, here’s a nice work-around script.

It's only fair to share...
Share on Facebook
Tweet about this on Twitter
Share on LinkedIn

Leave a Reply