Tuesday, December 1, 2009

CFC Function Declarations in Javascript

The last few days I have been working on having the ability of declaring pure Javascript functions and making them available as first class, top-level, citizens in the CFML world.

Setting up a separate CFC can be done using the following:

function myMethod( param1, param2 ) {
return $cf.getTickCount();

Note that you can mix CFSCRIPT, Javascript and CFML in the one CFML/CFC file. Each one can declare a top-level function and you can use whatever language you feel works best for you for that particular method.

From there on in, you can simply declare the CFC as normal and use without any problems.

Great progress being made on the server-side JavaScript in OpenBD! Since JavaScript is the lingua franca of web development, it's going to be great to have it fully integrated into our CFML toolbox.

No comments: