Posted in Development, ColdFusion | Posted on 02-11-2010 | 4,074 views
Earlier in the week I helped a reader with a iPhone issue he was having. From this came two things I'd like to share with folks. Number one - don't use Flash (sorry, couldn't resist!).
First - don't forget that Safari on the iPhone has a development mode. This is critical for getting any type of feedback for JavaScript errors. How do you enable this? Go to your Settings, Safari page. At the very bottom is a Developer menu. Click it and you will see...

Obviously you want to ensure the Debug Console is turned on. Once done, if you return to the browser and rerun your page with the error, you will see a new notice:

Clicking that option will give you some details about the error:

It's no Firebug, but it's better than nothing.
So what's the second tip? The error the user had involved a simple jQuery call to a CFC that returned JSON. It worked perfectly everywhere but the iPhone. Why? The iPhone didn't like the fact that the result didn't have the proper mime type. I asked him to add this line before his cfreturn: <cfcontent type="application/json" reset="true">. Unfortunately this kinda breaks the reusability of the component. To be a bit more abstract, he could add a quick check for URL.returnFormat first and only use the content type when necessary.


We are releasing an update soon of our sosContent.cfc that helps us deal with issues like this. I plan to do a some videos. The bottom line is there is alot of cool stuff that can be done with skinning web sites. If we package this stuff up and make it approachable, duplicateable and sustainable then in theory we can all be happy. :) Well, at least this type of issue will have a solution. Take a peak on riaforge at the current sosContent and it will give you a hint of where we are going. Oh, we are packaging the technology up into CFish version 2. There is not code on the project for that yet... it is coming. The CFish also includes technology to deliver content to multiple devices. If anyone wants in on the beta (and these libraries; CFish, sosContent are full free OS projects)
I'm using SC a bit more lately because I've switched to Chrome which doesn't support Firebug.
@Ray - maybe just me but the cfreturn code you said you added doesn't show up in the post (Chrome/OSX)
Damn nice.
http://www.socialfactory.net/iphone-applications.p...
[Add Comment] [Subscribe to Comments]