AJAX and FPCGI
Tyler
tyler.style at gmail.com
Thu May 21 11:45:00 PDT 2009
>
> Date: Thu, 21 May 2009 10:26:18 -0400
> From: Fairlight <fairlite at fairlite.com>
> Subject: Re: AJAX and FPCGI
>
> On Thu, May 21, 2009 at 07:13:43AM -0700, after drawing runes in goat's
> blood,
> Tyler cast forth these immortal, mystical words:
> > It is easy to use fpCGI with AJAX. I use it to send JSON formatted data
> > back and forth all the time.
>
> And you're doing what for the response MIME types? Because unless the
> server response type is correct, browsers tend to have problems with
> XMLHTTPResponse objects, and there is no way to make fPCGI change the MIME
> type in the response header.
>
> Maybe JSON is more lax about its types, but good luck with XML being
> handled properly by the classes meant to parse the data in the object if
> you don't do it the way it should be done. IE just likes to throw up a
> cryptic "Error", and even Firefox is pretty cryptic about what's going
> on--although it at least Firebug lets you see the cause of the issue.
> Sounds like (since you were using an external JSON class) it doesn't really
> care what the response format is, since the browser built-in classes don't
> have to deal with it. I guarantee that's not the case with traditional
> XML-based AJAX using the browser's object handling classes.
>
> And of the people doing AJAX, I'd probably guess >75% use XML, not JSON.
>
> The fact remains, fPCGI isn't designed to do AJAX properly. That you can
> trick it in one particular case doesn't make it correct for all cases.
>
Well, the OP didn't say anything about what format he was using. Since it's
filePro it's not like it has native XML output only, no other choices
available. If he's needing to write the processing table regardless, he can
always choose to go JSON. Also, 10sec on google produced a javascript JSON
to XML conversion lib: http://goessner.net/download/prj/jsonxml/. So still
not tragic.
As for usage, what is your >75% guess based on? I've never seen any stats
that even hint at the proportion. Anyway, Google and Yahoo both offer their
web service APIs in JSON, so the proportion can't be insignificant.
Personally I find JSON makes a lot more sense than XML if you have a choice
in export format. Much easier to work with on the client side, and MUCH
faster than XML. There are tons of blogs on the web extolling JSON over XML
for AJAX for these and other reasons.
The fact remains that fpCGI and filePro both aren't designed to deal with
almost any of the interfaces or standards created since the 80s properly
(before you say it: the fp SQL & ODBC stuff is *useless* for app dev without
writes!). That I can 'trick' it at all makes me frankly grateful! Any
interface that keeps me from having to explicitly manually import and export
text files via the local file system and so helps me break out of the fp
'jail' is a huge thumbs up. fpCGI was a real boon that way (tho I seriously
doubt that's what the creators had in mind, as all the other products seem
to be centered on keeping you locked into fp for developing your apps - much
like Microsoft, they probably never really thought of it as an alternative
application delivery infrastructure)
--
Tyler Style
http://malthusiansolutions.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.celestial.com/pipermail/filepro-list/attachments/20090521/adb9a696/attachment.html
More information about the Filepro-list
mailing list