This is an archive site. For the recent posts, visit orderedlist.com.

Ordered List

OrderedList

Jun 3 2005

SAJAX ColdFusion POST Request Method

I’ve been working on a project of late using hefty portions of AJAX. Given that much of the scripting environment at Notre Dame is ColdFusion, I have been making good use of SAJAX.

Sajax is an open source tool to make programming websites using the Ajax framework — also known as XMLHTTPRequest or remote scripting — as easy as possible. Sajax makes it easy to call PHP, Perl or Python functions from your webpages via JavaScript without performing a browser refresh. The toolkit does 99% of the work for you so you have no excuse to not use it.

The current 0.10 version of the toolkit includes scripts for most web languages (ASP/ColdFusion/Io/Lua/Perl/PHP/Python/Ruby), and I have been very pleased with how easy it is to use. If you’re looking to get started in AJAX, this is a good place to start.

My only issue was that the current ColdFusion script, which was originally ported by Eric Moritz, was limited to passing all variables via GET (a.k.a. passing them through the URI). As far as I am aware, this was the case for the original PHP file that was used to port the ColdFusion script, so this lack of POST is no fault of Eric’s. However, on the latest release of SAJAX, the PHP script included the option to allow POST requests as well as GET. The current application I’m working on required the use of this POST method, so I ported the changes to the PHP code on top of Eric’s ColdFusion script. Many thanks to Eric for his original translation of this code.

Download the updated ColdFusion AJAX script.