SunQuest
 
       ColdFusion
  Home arrow ColdFusion arrow Page 4 - CFAjax: What it is and How to Use it
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  
Actuate Whitepapers 
Moblin 
IBM® developerWorks 
Sun Developer Network 
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 / 31
    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
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    CFAjax: What it is and How to Use it - Code Analysis: The External js files


    (Page 4 of 5 )

    In the examples the relative references to these files are given. These have been changed in the present file (this tutorial) by giving absolute URL reference in the following three files.

    <script type='text/javascript' src='http://
    localhost/ajax/core/engine.js'></script> <script type='text/javascript' src='http://
    localhost/ajax/core/util.js'></script> <script type='text/javascript' src='http://
    localhost/ajax/core/settings.js'></script>

    ColdFusion function reference

    The function discussed earlier is used as shown here and is appended to the set of functions already present in the functions.cfm file in the examples folder. All examples reference file - functions.cfm from which the relevant function is processed during the XMLHTTP request.

    <cffunction name="RightangleTriangle">
    <cfargument name="x" required="yes" type="numeric">
    <cfargument name="y" required="yes" type="numeric">
    <cfset result=sqr(#x#*#x#+#y#*#y#)>
    <cfreturn result>
    </cffunction>

    In the fourth <script/>, the _cfscriptLocation variable points to functions.cfm which also contains the function whose name is "RightangleTriangle" appended to it. The functions.cfm collects all the functions from several examples in the examples folder. An abbreviated version of functions.cfm is as shown below:

     

    <!--- hint="type=keyvalue, jsreturn=array , listdelimiter=| , delimiter='='" --->
    <cfinclude template="/ajax/core/cfajax.cfm">
    <cffunction name="ziplookup">
    <!---details of 'ziplookup' funciton--->
    </cffunction>
    <cffunction name="countylookup">
    <!---details of 'countylookup' function-->
    </cffunction>
    <cffunction name="stateinfo">
    <!---details of 'stateinfo' function--->
    </cffunction>
    <!---   ......   --->
    <!---many other functions follow--->                                                                                 <!---   ......   --->
    <cffunction name="RightangleTriangle">
    <!---
    details of function used in this tutorial-->
    <cfargument name="x" required="yes" type="numeric">
    <cfargument name="y" required="yes" type="numeric">
    <cfset result=sqr(#x#*#x#+#y#*#y#)>
    <cfreturn result>
    </cffunction>


    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







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