ColdFusion 8 Ajax Controls: A Little Thought Can Save Your Butt

ColdFusion 8 is looking very hot and its gotten a tremendous amount of much deserved attention. Having done Ajax development with other tools, I'm obviously very interested in the Ajax widget tags included in CF8.

Dan Vega had a nice, straightforward example of using CFWINDOW to build a very sweet looking dynamic window. When I did a “view source”, I was kind of shocked by the amount of javascript libs being included. You had files from Yahoo User Interface (YUI), Ext, and some others which seemed specific to Adobe (Spry maybe?). There were a total of 12 javascript files loaded automatically by CF 8 in order to popup the dynamic window.
So I whipped out FireBug and did a quick analysis and noticed that the libraries totaled ~330KB! Holy cow! There's a lotta library in that page. Now you might say, “whats the big deal? Customers have broadband!”. Um, sorta. While broadband continues to grow steadily, its still important to consider those visitors on the low end of the spectrum (eg: dial-up).

This got me thinking about some of the things that I've had to contend with as I got involved with client-side development; especially Ajax.

Using these new tags is definitely enticing and its going to give CF developers a great way to get introduced to client-side dynamic effects including Ajax, without the headaches of hand-coding so much stuff. Shoot, Ben Forta has posted 3 CF8/Ajax tutorials that have stunned me due to the power and simplicity of the implementation.

But for those just jumping into this whole DOM/JS/Ajax thing, it is REALLY important to evaluate your visitor expectations not only from a business perspective but a technology perspective. Don't make the assumption that every visitor you have has broadband or, even tougher to deal with, JavaScript-enabled. If you're targetting customers who traditionally are not the most “wired”, you may be in for a big surprise when they encounter a site thats not as responsive as you thought. This could equal lost customers and/or lost sales.

So my point is to tell you to definitely embrace the new Ajax widgets in CF8 (and those of any library) with a little forethought. By doing so, you need to start rethinking your approach to how your target audience will be affected. Everything from bandwidth to accessibility to security will now need to be thought through to make sure your apps work for your visitors.

To get you started with CF8's Ajax capabilities, here are a couple of tutorials from Guru Ben Forta:

ColdFusion Ajax Tutorial 1: Auto-Suggest
ColdFusion Ajax Tutorial 2: Related Selects
ColdFusion Ajax Tutorial 3: Live Data Grids

I would also HIGHLY recommend this posting to get to understand progressive enhancement.

Progressive enhancement with Ajax

If you don't know what progressive enhancement is and you're planning on implementing DHTML and Ajax, you're doing yourself and especially your site visitors a disservice.

Welcome to Ajax fellow CF'ers!