Nov 28, 2010

Which layout do you prefer jQuery and ColdFusion


Or



Here is a demo: http://kukiel.net/demos/jquery/1/

Here is the CFC:


I'm partial to option 1.

6 comments:

  1. BTW the example is running on Bleeding edge Railo which has full script support.

    ReplyDelete
  2. Personally I usually go with the first example, unless I can make a reusable even handler. If that were the case I would use the second example.

    ReplyDelete
  3. The first example is much cleaner. However, if I need a global return handler or error handler the 2nd is better.

    ReplyDelete
  4. 2nd is cleaner, the 1st one gets hard to read quickly, best to separate early.

    ReplyDelete
  5. I prefer option 1 unless I need to reuse the callback event.

    ReplyDelete
  6. The other thing to note here is that you are always assuming that the component is in the same directory as the calling template.

    If you use mappings with virtual directories this will not work.

    ReplyDelete