CFAjax is an Ajax implementation for ColdFusion. It makes ColdFusion method calls on server directly from HTML page using JavaScript and return backs the result to the calling HTML page. CFAjax comes with simple to use JavaScript API and simple ColdFusion implementation that marshal’s the response between your CF methods and HTML page. Using CFAjax you can create highly interactive websites with greater performance and usability.
This one forwarded to me by Greg Ostravich, thanks.

16 thoughts

  1. Thanks for picking this up, Ben. I had read the boilerplate at the site too, but didn’t download to learn what it actually did, and how. If there’s actually CF markup sent from the client engine, then this seems to imply that your server will process arbitrary CF from arbitrary IP addresses, which doesn’t seem safe. Have you seen fuller details on what they’re actually doing here…?

  2. JD, the code is making HTTP calls to CFC methods (in much the same way as a SOAP or AMF request would be made), and then processes the results which are in a specified XML format. Actually, the flow is exactly how CFC methods are invoked via SOAP and AMF, with the exception being that ColdFusion has SOAP and AMF wrappers so that code can return any data (string, number, array, …) and the gateways on the server handle converting data as needed, whereas the CFC methods used with CFAjax have a very fixed output format that must be manually generated. And so yes, servers will process requests from arbitrary IP addresses (just as they typically would with SOAP and AMF requests). If you needed an authentication layer you could definitely build that, I don’t see why identifiers (like jsessionid or cfid/cftoken) could not be passed back in the request.

  3. JD, just to clarify, it is not passing CFML code to be processed, it is passing values to CFC methods (much like FORM and URL parameters do).

  4. This is very cool. I’ve recently started to play with DHTML scripts to give more options on pages without having to refresh. This is a nice next step.
    I’ve kind of taken the method of, if google can do it, why can’t i?

  5. Ah, cool, thanks… so they’re calling methods of encapsulated components specifically created for remote usage, instead of calling ColdFusion tags directly… that sounds safer than my initial takeaway on that text, thanks.
    And I guess the "*JaX" part is that they’re relying on each browser’s ability to request, parse and redisplay that XML-transferred data, instead of something like the HTML-replacement technique in Ruby On Rails… am I seeing the second part of this communication path correctly now?
    (Jerry, if you’re viewing a webpage which uses XmlHttpRequest in Safari, then you may need to upgrade your operating system to get a newer Safari… I’ve got a Jaguar Safari which silently fails on many of these "AJaX" pages too.)

  6. JD, correct. The calls to CFC methods return data, and JavaScript then updates the page to display that data as needed.

  7. I have the latest version of everything, so I can’t upgrade any further.
    Tiger 10.4.1
    Safari 2.0 (412)

  8. I think I’ll get a tattoo… "Every ‘AJaX’ demo really should have a support page"…. 😉

  9. just a quick thought:
    we ditched the idea of calling CFC’s directly in our xmlhttprequest calls bacause we need to add session vars to the call for the cfc.
    sure we could create a facade CFC that breaks encapsulation and has session[""] references in it but it’s easier for us to have a dedicated cfm page called by the javascript that then calls the controller cfc’s for data.
    this is no big deal but I just wanted to throw this up as an alternative idea.
    my 2c

  10. Jeff, not really, no. If CFCs are used on the back end then you’d obviously need CFMX or later, but as far as being able to respond to requests, any version can do that.

  11. Ben and others,
    We are just beginning to look into AJAX and are having discussions about the pros and cons. When you get a chance, could you all take a look at some of these comment back to this post or to my email address ( Any insights you have would be greatly appreciated.

Leave a Reply