<div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Date: Thu, 21 May 2009 10:26:18 -0400<br>
From: Fairlight <<a href="mailto:fairlite@fairlite.com">fairlite@fairlite.com</a>><br>
Subject: Re: AJAX and FPCGI<br>
<br>
On Thu, May 21, 2009 at 07:13:43AM -0700, after drawing runes in goat's blood,<br>
Tyler cast forth these immortal, mystical words:<br>
> It is easy to use fpCGI with AJAX. I use it to send JSON formatted data<br>
> back and forth all the time.<br>
<br>
And you're doing what for the response MIME types? Because unless the<br>
server response type is correct, browsers tend to have problems with<br>
XMLHTTPResponse objects, and there is no way to make fPCGI change the MIME<br>
type in the response header.<br>
<br>
Maybe JSON is more lax about its types, but good luck with XML being<br>
handled properly by the classes meant to parse the data in the object if<br>
you don't do it the way it should be done. IE just likes to throw up a<br>
cryptic "Error", and even Firefox is pretty cryptic about what's going<br>
on--although it at least Firebug lets you see the cause of the issue.<br>
Sounds like (since you were using an external JSON class) it doesn't really<br>
care what the response format is, since the browser built-in classes don't<br>
have to deal with it. I guarantee that's not the case with traditional<br>
XML-based AJAX using the browser's object handling classes.<br>
<br>
And of the people doing AJAX, I'd probably guess >75% use XML, not JSON.<br>
<br>
The fact remains, fPCGI isn't designed to do AJAX properly. That you can<br>
trick it in one particular case doesn't make it correct for all cases.<br>
</blockquote></div><br>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: <a href="http://goessner.net/download/prj/jsonxml/">http://goessner.net/download/prj/jsonxml/</a>. So still not tragic.<br>
<br>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.<br>
<br>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)<br>
<br>
--<br>
Tyler Style<br>
<a href="http://malthusiansolutions.com/" target="_blank">http://malthusiansolutions.com</a><br>