ColdFusion
  Home arrow ColdFusion arrow CFAjax: What it is and How to Use it
IBM Developerworks
Iron Speed
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Download TestComplete 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
COLDFUSION

CFAjax: What it is and How to Use it
By: Jayaram Krishnaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 29
    2006-02-14

    Table of Contents:
  • CFAjax: What it is and How to Use it
  • Implemented ColdFusion Function
  • CFAjax implementation of a ColdFusion function
  • Code Analysis: The External js files
  • MyCFAjax.htm file

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    Iron Speed
     
    ADVERTISEMENT

    Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

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

    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.

    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 ().

    More ColdFusion Articles
    More By Jayaram Krishnaswamy


       · Ajax is here to stay. All platforms, especially those web related will have great...
       · You gave a good example for ColdFusion and Ajax, but I have one suggestion. Can you...
       · Thanks. The OnLoad() for the body was used, any other event would do just the same....
       · The program may need a little TLC for user:Square Root of ( <input id="x"...
       · Square Root of ( <input id="x" name="x" value=3 onChange="loadInfo()"> ^ 2 +...
       · First of all, thanks for posting CFAjax: What it is and How to Use it. A very...
       · Let me know at what point you have the problem:1. Did you download CFAJAX from...
       · Great article!I think the MyCFAjax.htm input boxes are missing a call to the...
       · I know this is an old thread, but just in case someone stumbles upon this and needs...
     

    COLDFUSION ARTICLES

    - 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...
    - My First Application on ColdFusion MX Server


     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway