Home arrow ColdFusion arrow CFAjax: What it is and How to Use it

CFAjax: What it is and How to Use it

This is for ColdFusion aficionados who want to use Ajax. Ajax is implemented in such a way that ColdFusion method calls on the server gets executed using JavaScript a la Ajax. This tutorial shows you where to get the code and how to implement it on your local server.

Author Info:
By: Jayaram Krishnaswamy
Rating: 4 stars4 stars4 stars4 stars4 stars / 59
February 14, 2006
  1. · CFAjax: What it is and How to Use it
  2. · Implemented ColdFusion Function
  3. · CFAjax implementation of a ColdFusion function
  4. · Code Analysis: The External js files
  5. · MyCFAjax.htm file

print this article

CFAjax: What it is and How to Use it
(Page 1 of 5 )

As you would expect, I will also describe an (extremely simple) to show how the code works. After this the reader may experiment with other samples provided by the CFAjax site. Some of the examples may not work immediately unless the virtual directory for testing is set up in a certain way.

From where do you download?

First thing first, you may download CFAjax from here. In writing this tutorial, the Zip file, cfajax.1.3.zip was down loaded to the local machine.  CFAjax is the name of a new folder located on the desktop at: C:\Documents and Settings\computer user\Desktop\CFAJAX\ into which the contents of the zip file were unzipped.

How do you set it up?

In this step you will set up a virtual directory to park your downloaded files on your local server.  It is assumed that your web site can handle ColdFusion files. If not, I suggest you read this article on ASP Free.

Open your IIS in the MMC (Microsoft Management Console). Expand the Web Sites folder to reveal the Default Web Site. Right click on Default Web Site and choose New -> Virtual Directory... as shown.

The Virtual Directory Creation wizard opens up. Click on Next in the Welcome screen. For the Virtual Directory Alias enter ajax as shown and click Next>. It is important you do not change, or use your own. Once you get familiar with this process you can do what you like.

This opens up the window where you need to indicate the location from which content is coming.  For the Web Site Content Directory click on the Browse... button and locate the CFAjax directory where you unzipped the downloaded zip file. This is chosen by expanding nodes in the Browse for Folder tree view window.

You should see the following in the directory information textbox in For the Web Site Content Directory: C:\Documents and Settings\computer user\Desktop\CFAJAX

Click Next.  In the screen that follows accept the default permissions as shown in permissions. You can change them later if necessary.

After accepting the default permissions, click on Next. This completes your virtual directory. Now your ajax virtual directory should appear as shown in the next picture.

Now you are ready to use and develop programs for CFAJAX. The CFAjax installation has the folders, app, core, examples, and utility. It also has its default.htm. The directory hodentek has been added to keep files developed separate from the original files.

CFAjax folder contents

Now you are ready to use and develop programs for CFAJAX. The CFAjax installation has the following folders: app, core, examples, and utility. It also has its default.htm.  Most of the required items are in the folders core and utility. The app and examples folders contain code developed using functionalities in core and utility. The core folder contains the JavaScript files, engine.js and util.js. The XMLHTTP object is contained in a DWRengine function in CFAjax.  The util.js helps in sending parameters (arguments) and presenting return values via the DOM. The DWRengine's execute () method is the one that sends the data to the server via XMLHttp ().

blog comments powered by Disqus

- Adobe ColdFusion Just Got More RAD
- How to Access a SQL Anywhere Database with C...
- CFXML: Probing XMLDOM in ColdFusion
- Creating a Web Service with ColdFusion: the ...
- CFAjax: What it is and How to Use it
- Querying SQL 2000 Server from ColdFusion
- Introduction to ColdFusion Markup Language, ...
- Introduction to ColdFusion Markup Language
- Databases and Dreamweaver MX 2004, concluded
- Databases and Dreamweaver MX 2004
- Welcome to Coldfusion MX 6.1, concluded
- Welcome to Coldfusion MX 6.1
- What You Must Know About ColdFusion Flow-Con...
- What You Must Know About Operators in ColdFu...
- Everything You Must Know About ColdFusion Va...

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 

Developer Shed Affiliates


© 2003-2019 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials