blog | bio | agenda | jobs | ajaxCFC

ajaxCFC examples

I added two simple examples of ajaxCFC:

Echo example sends a string to the server, which just echoes it back to JavaScript and gets appended in a Div.

Complex object example uses the exact same code as echo, but this time it seamlessly receives a complex object from JavaScript and echoes it back. I used sDumper.js to dump the object into screen.

The component is extremely simple, all you have to do is extend ajax.cfc and you’re in business.
 
<cfcomponent extends="ajax">

    <cffunction name="echo" output="no" access="private">
        <cfargument name="args">
       
        <cfreturn args [1] />
    </cffunction>

</cfcomponent>

I tested this code with I.E 5.5, I.E 6, Netscape 7.2, FF 1.0+, FF 1.5, and Safari.

I will add more examples and add some documentation this weekend. I updated the zip file to include these examples as well.

TrackBacks
There are no trackbacks for this entry.

Trackback URL for this entry:
http://www.robgonda.com/blog/trackback.cfm?11281AED-3048-7431-E4977FE438400B54

Comments
looks cool rob, thanks for the heads up!
sitting here watching duke and texas play and might just put this puppy to use in my ncaa march madness application. time to start anyway... march will be here before you know it.

later.
tony
# Posted By tony of the weeg clan | 12/10/05 1:17 PM
It works and Opera 9.0 TP.
Looks great!!! It's very easy to use and understanding!
# Posted By injun #576871 | 12/10/05 11:46 PM
When I unzip the files into a subdir under a virtual server and run any of the examples, I get the error

"The page isn't redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete."
# Posted By Edward Borland | 1/16/06 7:29 PM
Ed, thanks for contacting me by email. I'll fill in the rest of the readers here. My examples folder does not have an application.cfm/cfc, so any instance of application you might have will affect the code.
# Posted By Rob Gonda | 1/16/06 8:52 PM
BlogCFC was created by Raymond Camden. This blog is running version 5.1.004.