[jQuery] Re: getJSON w/ PHP

2007-06-18 Thread Brad Perkins
Jake, That fixed it. Thanks! On Jun 18, 11:41 am, Ⓙⓐⓚⓔ [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

[jQuery] Re: getJSON w/ PHP

2007-06-18 Thread Jake McGraw
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

[jQuery] Re: getJSON w/ PHP

2007-06-18 Thread Aaron Heimlich
This assumes, of course, that you: A) Are using PHP 5.2 B) Have the json extension installed from PECL[1] If neither of those apply to you, then there a bunch of pure PHP packages listed in the PHP section near the bottom of http://www.json.org. [1] pecl.php.net/package/JSON On 6/18/07,

[jQuery] Re: getJSON w/ PHP

2007-06-18 Thread Brad Perkins
They are still using PHP 4, but do have the PEAR JSON library installed. I plan to use it. -- Brad On Jun 18, 12:24 pm, Aaron Heimlich [EMAIL PROTECTED] wrote: This assumes, of course, that you: A) Are using PHP 5.2 B) Have the json extension installed from PECL[1] If neither of those

[jQuery] Re: getJSON w/ PHP

2007-06-18 Thread Jake McGraw
Just saw a video on why this is by Douglass Crockford Technically, you can use unquoted labels ala {var1:value1}, but JavaScript will have errors when you try to use reserved words like for and switch. Rather than write the JSON standard for labels using: Attribute names can be unquoted as

[jQuery] Re: getJSON w/ PHP

2007-06-18 Thread Mike Alsup
Interesting. That makes sense. Thanks for the info, Jake! Just saw a video on why this is by Douglass Crockford Technically, you can use unquoted labels ala {var1:value1}, but JavaScript will have errors when you try to use reserved words like for and switch. Rather than write the

[jQuery] Re: getJSON w/ PHP

2007-06-18 Thread Jake McGraw
Crockford talking about his experience with js, somewhere towards the middle he talks about inventing JSON (the language implementation, not the concept) and his discovery of the issue of reserved words in object literals: http://video.yahoo.com/video/play?ei=UTF-8gid=133414vid=630959b=1 It