Home arrow ColdFusion arrow Page 2 - CFAjax: What it is and How to Use it
COLDFUSION

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
TABLE OF CONTENTS:
  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
SEARCH DEVARTICLES

CFAjax: What it is and How to Use it - Implemented ColdFusion Function
(Page 2 of 5 )

The following ColdFusion function, 'test_this ()' will be implemented using the tags <cffunction/>. Put simply, this function takes two arguments, x and y. The function produces the result, which is the square root of summing the values of x * x and y * y.

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

This function may be tested with the following statement added to the above. The resulting CFM file TestThis.cfm calls the function 'test_this' passing the arguments 3 and 4 to the function. The browser output for this is shown in the next picture. Five is the correct answer for square root of (3^ 2 + 4 ^ 2).

<cfoutput>
#test_this("3","4")#
</cfoutput>

blog comments powered by Disqus
COLDFUSION ARTICLES

- 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 
Support 

Developer Shed Affiliates

 




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