09.18
So last week I finally started messing with AJAX at work. Yes, at work. See, it doesn’t all suck
.
It’s been a while since I’ve done any JavaScript so it was kinda nice to see how the language had grown.
I fooled first with a .NET client-side custom validator to check the status of a database record given the ID. This wasn’t actually asychronous given the nature of .NET client-side validators, but it was a start. It basically queries a .NET Web Service via POST through the XMLHttpRequest object and uses basic DOM commands to ferret out the result. Simple, but effective. Not scalable
.
The real AJAX started with a proof-of-concept idea of repopulating an HTML table using data asychronously transferred as JSON. Before this was all was done via a page reload, but using AJAX allowed me to a) avoid the refresh, b) act asychronously and most importantly c) cache the result, thereby limiting hits to the database. It took learning a lot more DOM parsing, but was worth it. I was very excited when I got it working. Still, no plans to actually deploy said tweaks as the particular interface tested on lives on a rather fast internal network with very few users. Oh look, now it reloads REALLY fast….
Now I’m really jazzed about what I have planned next week: Like a textbook section stating “Lets put all the things we’ve covered in the last few chapters together…” I’m gonna mix a couple of new (to me) technologies to add spell checking to a web-based text entry app I maintain.
Enter the Google APIs. They have a spell checking SOAP Web Service. While JavaScript can do SOAP in some capacity or other, it’s kinda kludgy. By writing a 10-ish line Perl CGI script using SOAP::Lite I in effect have a wrapper around the Google spelling web service I can call directly (and asychonously) from XMLHttpRequest in my JavaScript. I have all the peices written… and tested… Now I just gotta put ‘em together.
Cool, no?









