Rob Gonda's Blog

Cf.Objective: two-day conference for $275

Cf.Objective just opened its doors. Early bid it a bargain, just $275. There's a call for speakers, and Hal Helms, Sean Corfield, and Joe Rinehart already confirmed.

It's the day before the Ajax Seminar, so it will be tough, but I'll try to make it.

ajaxCFC: server side JavaScript and dynamic content

To illustrate the idea of my previous post, I just added an example that stores the JavaScript in the server side and leaves only core connectivity and UI functionality in the client side.

It uses a simple DHTML popup windows library and sends the instruction along with the content back to the callback function, which simply executes the server’s request.

This example is not a full application and is far from perfect. It has no validations, no even listeners, or any advanced functionality. It is only meant to show how to control your JavaScript code in the server instead of the client.

What Is Ajax? : 40,000+ reads

One of my articles for the CFDJ reached over 40,000 reads today. I had never imagined that it would be such a success; it seems to be one of the most read articles in the history of the CFDJ, which is a real honor. I know most of my readers have already seen it, but if you have not, please do: http://coldfusion.sys-con.com/read/138966.htm

IMO RIA's, including AJAX, Laslo, Flex 2.0, and XAML will be huge topics for 2006, so stay ahead of the competition and start doing your research now.

Btw, XAML is short for eXtensible Application Markup Language, and pronounced "Zammel".

Mozilla has its own version, but it won't go anywhere… it's called XUL, short for  User Interface Language and pronounced "zool"... XUL followers feel free to argue this statement.

cfhttp and gzip compression

I just wasted an hour with a simple cfhttp post problem, and I wouldn't wish any of my readers to go through the same process.

I was integrating with a bank to get a deposit slip completely filled up with client information and allow my client to print it without leaving my site. When I manually posted the form to the bank it worked, but through CF I kept getting a Connection Failed in the body. I knew if wasn't blocking me, because it also provided me with an ASP session cookie; so I looked at the headers using an http packet sniffer and I saw two variables that could be a problem: Transfer-Encoding: chunked, and Content-Encoding: gzip.

After an hour, I discovered that CF, or even worse, Java will not accept gzip encoding, so right when I was about to give up, I found that I can request a specific encoding by supplying http headers for 'Accept-Encoding'.

Here's the magic:


<cfhttpparam type="Header" name="Accept-Encoding" value="deflate;q=0">
<cfhttpparam type="Header" name="TE" value="deflate;q=0">


After I added those two lines inside my cfhttp, everything started working like a charm (as it should).

Next time you get a Connection Failed and have absolutely no clue on why it is behaving that way, make sure you check the content encoding of that web server.

Best 10 ColdFusion posts for 2005

For all those ColdFusion people who don't read Rob Brooks, Sean Corfield, or Steven Erat's blogs (because they already mentioned this), you should check Rob's blog out. He posted today his top 10 blog posts picks. Whereas it may be a little bias towards object oriented design and design patterns, I do agree that every single one of the posts he mentions it's worth reading. Please do not think I'm against OO, au contraire, I love it, and live by design patterns … but anyways, it's a must read so check it out.

modified ping component for blogCFC

I took the liberty to completely rewrite blocCFC's ping component. I wrote a generic XML-RPC function, that takes pings and extended rpc pings, added a few more aggregators, and modified the timeout for the responses because they are not really important...

I tested every single aggregator and they all work except blo.gs ... but I left it in there because I think it may be temporary. You can ping now @technorati, @weblogs, @icerocket, @blogdigger, @yahoo, and @moreover

I also couldn't get feedster going ... you're supposed to ping http://api.feedster.com/ping, but it seems that the page has been moved or something; I’d appreciate if someone could provide any information on feedster.

I attached the modified ping.cfc to this post. I sent Ray the update, and thus far, he has been great by adding them to new releases.

Thanks again Ray!

ajaxCFC with security and debugging released

I just uploaded a new release of ajaxCFC with some really nice additions.

ajaxCFC now supports built-in improve security, enforcing get or posts verbs, and also optionally checks for the http-referer to match your site. These two checks will prevent a third party to monitor http packets and try to call them manually by pasting the full ajax request to a browser.

I personally always Firefox and Live HTTP headers debug my ajax applications and I recommend using get methods and allow blank referers for development environments; but you need to be able to lock it down for production.

And talking about development, don't you hate when you think you're doing everything right, but there is no way to see what the server is getting out of your ajax request? I added some debugging abilities too that write into a debug file.

More details on the implementation of these updates are available in the documentation inside the download.

ajaxCFC small fixes

I just updated the project files to include the following fixes:
 

  • replaced the /exec/method after the CFC call with get or post vars because it was being misinterpreted by some web servers
  • Forced ColdFusion debugging to stay off for ajax calls because they were breaking the JavaScript response.
Thank you Steve and Tony for your help.

ajaxCFC documentation added

I just updated the ajaxCFC download with initial documentation. I’ll keep improving as there is always room for improvement, but it has the minimal explanations and instructions to install and use.

If I’m missing something please do not hesitate to contact me, I will appreciate it.

ajaxCFC synchronous form validation

Now for the synchronous advantages, I created an example that shows one of the advantages for synchronous ajax. Upon form submission, a simple JavaScript code check for required fields and alerts a single message with the errors summary (try submitting a blank form).

If the email is provided, an ajax call makes sure the user doesn't already exist. Emails are stored in the session, if you try to create the same email more than once, the JavaScript alert will inform you that the email already exists. The advantage of the call being synchronous is that is can be incorporated with the rest of the form validation.

This process is doable with asynchronous ajax, but the only way to do it is for the form validation to always return false, and the call back function re-submit the form if appropriate. This process start becoming tedious if you need to validate several fields, such as address, email, captcha, username, and any other you may think of. The only way would be that each ajax call had to be initiated in the call-back from the previous call, in a cascade fashion… then also storing all the different results if you wanted to display a single error alert summary.

by the way, I added the multithreaded example and this one to the ajaxCFC download.

More Entries

This blog is running version 5.9.003. Contact Blog Owner