CF8 and json for Ajax - remember the UPPERCASE rule

Just a quick CF8 gotcha that can cause annoying problems if you aren't aware of it.

Basically, if your doing any AJAX in CF8 and using the returnFormat="json" functionality to get a CFC (with access="remote") to return data to Javascript on the frontend, remember this:

ColdFusion internally represents structure key names using all-uppercase characters

So what this basically means is that no matter how you specify your structure data in Coldfusion (e.g params.userName = "james"), when it arrives on the frontend via Javascript you MUST use UPPERCASE variable names.

E.G alert(proxy.USERNAME);

Just something to watch out for as it can catch you out..

Comments (Comment Moderation is enabled. Your comment will not appear until approved.)
© 2014 James Allen | Contact Me
This blog runs on the awesome power of BlogCFC - created by Raymond Camden. This blog is running version 5.9.