>> GreenByte.info By Nick Tong (quiksilv) | Supported by: TalkWebSolutions.co.uk

JSON and CFCs

I've just been playing around with getting SPRY to use JSON datasets. It's worth checking out Ray Camdens posts on how he updated lighthousepro to use JSON. One issue I had though was, I call my JSON data via a CFC which causes SPRY to have issues.

Could not convert undefined or null to object Backtrace

Check out this post form more information: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:52382

The solution appears to be that you can update your spry files where it does the http request like this

var strTest = http.responseText; strTest = strTest.replace(/(<\/?META[^>]*>)/gi,'');

This then helps solve the meta tag issue.

It's worth noting that CF8 will help you resolve this issue as it lets you specify a return format.

Thanks to Scott for this solution.


 
Comments
Raymond Camden's Gravatar I think you need to make it clear to your readers (although it is if they follow the link) that this is ONLY the case when using the developer edition of CF. This would not be needed on a non-dev edition.
# Posted By Raymond Camden | 13/07/07 19:41 | Report abusive comment
BlogCFC was created by Raymond Camden. This blog is running version 5.5.1.