I think Jake nailed it, when using php and json, why not use
json_encode? Observe:

echo json_encode(array("ok"=>true,"state"=>"OUT-DECOMMISSIONED"));

php-json is native in PHP 5.2 and above, and available as a plugin here:

http://aurore.net/projects/php-json/

and will always* produce valid json from arrays.

- jake

* - As much as I've used it, I haven't come across a single problem.

On 6/18/07, Ⓙⓐⓚⓔ <[EMAIL PROTECTED]> wrote:
do you have variables named OUT and DECOMMISSIONED?

or did you mean 'OUT-DECOMMISSIONED'

as in

<?
echo "{ok:true,state:'OUT-DECOMMISSIONED'}";
> ?>



On 6/18/07, Brad Perkins <[EMAIL PROTECTED]> wrote:
>
> I'm trying to use getJSON to return some JSON from a PHP page. I can
> see that the request is returning the expected response with Firebug,
> but the getJSON callback isn't firing?
>
> My PHP is simply
>
> <?
> echo "{ok:true,state:OUT-DECOMMISSIONED}";
> ?>
>
> Do a need to set a special content type before returning the JSON?
>
>



--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ

Reply via email to