<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: Easy JSON Encoding/Decoding in PHP</title>
	<atom:link href="http://thecodecentral.com/2007/09/13/easy-json-encodingdecoding-in-php/feed" rel="self" type="application/rss+xml" />
	<link>http://thecodecentral.com/2007/09/13/easy-json-encodingdecoding-in-php</link>
	<description>Programmer's blog for programmers</description>
	<pubDate>Thu, 04 Dec 2008 00:26:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: darksama</title>
		<link>http://thecodecentral.com/2007/09/13/easy-json-encodingdecoding-in-php#comment-7398</link>
		<dc:creator>darksama</dc:creator>
		<pubDate>Fri, 11 Apr 2008 06:22:13 +0000</pubDate>
		<guid isPermaLink="false">http://thecodecentral.com/2007/09/13/easy-json-encodingdecoding-in-php#comment-7398</guid>
		<description>It sounds good, I love the simplicity. Your posts are easy as a pie and really attractive at the same time.</description>
		<content:encoded><![CDATA[<p>It sounds good, I love the simplicity. Your posts are easy as a pie and really attractive at the same time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: YUI Based Lightbox - Revisited : Code Central</title>
		<link>http://thecodecentral.com/2007/09/13/easy-json-encodingdecoding-in-php#comment-5342</link>
		<dc:creator>YUI Based Lightbox - Revisited : Code Central</dc:creator>
		<pubDate>Thu, 13 Mar 2008 07:23:40 +0000</pubDate>
		<guid isPermaLink="false">http://thecodecentral.com/2007/09/13/easy-json-encodingdecoding-in-php#comment-5342</guid>
		<description>[...] Easy JSON Encoding/Decoding in PHP [...]</description>
		<content:encoded><![CDATA[<p>[...] Easy <span class="caps">JSON</span> Encoding/Decoding in <span class="caps">PHP </span>[...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cuong</title>
		<link>http://thecodecentral.com/2007/09/13/easy-json-encodingdecoding-in-php#comment-3820</link>
		<dc:creator>Cuong</dc:creator>
		<pubDate>Mon, 21 Jan 2008 23:51:31 +0000</pubDate>
		<guid isPermaLink="false">http://thecodecentral.com/2007/09/13/easy-json-encodingdecoding-in-php#comment-3820</guid>
		<description>Both perform essentially the same thing. The only catch is that json_decode is not available in PHP prior to version 5.20.</description>
		<content:encoded><![CDATA[<p>Both perform essentially the same thing. The only catch is that json_decode is not available in <span class="caps">PHP </span>prior to version 5.20.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://thecodecentral.com/2007/09/13/easy-json-encodingdecoding-in-php#comment-3818</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Mon, 21 Jan 2008 23:37:48 +0000</pubDate>
		<guid isPermaLink="false">http://thecodecentral.com/2007/09/13/easy-json-encodingdecoding-in-php#comment-3818</guid>
		<description>So what does the Zend class do that the native PHP json_encode and json_decode functions don't? (Apart from being available in an earlier version of PHP)</description>
		<content:encoded><![CDATA[<p>So what does the Zend class do that the native <span class="caps">PHP </span>json_encode and json_decode functions don't? (Apart from being available in an earlier version of <span class="caps">PHP</span>)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cuong</title>
		<link>http://thecodecentral.com/2007/09/13/easy-json-encodingdecoding-in-php#comment-2516</link>
		<dc:creator>Cuong</dc:creator>
		<pubDate>Mon, 24 Dec 2007 20:18:15 +0000</pubDate>
		<guid isPermaLink="false">http://thecodecentral.com/2007/09/13/easy-json-encodingdecoding-in-php#comment-2516</guid>
		<description>Sorry your earlier comment was placed to moderation. I see what you are trying to do now.

Apparently this is a JSONP request. You have to wrap your entire JSON response with the callback you specified in the URL, which is "callback" in this case:

&lt;pre&gt;
callback( {"job_Description":"My Job","job_Notes":"My jobs notes are here."} )
&lt;/pre&gt;

http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/


If cross-site scripting is not required, you can simply change this line from 
&lt;pre&gt;
var url = "http://127.0.0.1/projects/client_api/test?callback=?";
&lt;/pre&gt;
to
&lt;pre&gt;
var url = "http://127.0.0.1/projects/client_api/test";
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Sorry your earlier comment was placed to moderation. I see what you are trying to do now.</p>
<p>Apparently this is a <span class="caps">JSONP </span>request. You have to wrap your entire <span class="caps">JSON </span>response with the callback you specified in the <span class="caps">URL, </span>which is "callback" in this case:</p>
<pre>
callback( {&quot;job_Description&quot;:&quot;My Job&quot;,&quot;job_Notes&quot;:&quot;My jobs notes are here.&quot;} )
</pre>
<p><a href="http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/" rel="nofollow">http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/</a></p>
<p>If cross-site scripting is not required, you can simply change this line from </p>
<pre>
var url = &quot;http://127.0.0.1/projects/client_api/test?callback=?&quot;;
</pre>
<p>to</p>
<pre>
var url = &quot;http://127.0.0.1/projects/client_api/test&quot;;
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cuong</title>
		<link>http://thecodecentral.com/2007/09/13/easy-json-encodingdecoding-in-php#comment-2493</link>
		<dc:creator>Cuong</dc:creator>
		<pubDate>Fri, 21 Dec 2007 08:15:19 +0000</pubDate>
		<guid isPermaLink="false">http://thecodecentral.com/2007/09/13/easy-json-encodingdecoding-in-php#comment-2493</guid>
		<description>The code has to be escaped through &#60;pre&#62;&#60;/pre&#62;.

It seems like you haven't yet parsed this json string.

With jQuery, try:
&lt;pre&gt;
jQuery.post( url, data, callback, "json") ;
or
jQuery.getJSON( url, data, callback );
&lt;/pre&gt;

for more information please visit 
http://thecodecentral.com/2007/11/20/the-missing-parameter-of-jquerypost.

Without jQuery:
&lt;pre&gt;
eval('('+'{"job_Description":"My Job","job_Notes":"My jobs notes are here."}'+')');
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>The code has to be escaped through &lt;pre&gt;&lt;/pre&gt;.</p>
<p>It seems like you haven't yet parsed this json string.</p>
<p>With jQuery, try:</p>
<pre>
jQuery.post( url, data, callback, &quot;json&quot;) ;
or
jQuery.getJSON( url, data, callback );
</pre>
<p>for more information please visit <br />
<a href="http://thecodecentral.com/2007/11/20/the-missing-parameter-of-jquerypost" rel="nofollow">http://thecodecentral.com/2007/11/20/the-missing-parameter-of-jquerypost</a>.</p>
<p>Without jQuery:</p>
<pre>
eval('('+'{&quot;job_Description&quot;:&quot;My Job&quot;,&quot;job_Notes&quot;:&quot;My jobs notes are here.&quot;}'+')');
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://thecodecentral.com/2007/09/13/easy-json-encodingdecoding-in-php#comment-2463</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Tue, 18 Dec 2007 04:25:15 +0000</pubDate>
		<guid isPermaLink="false">http://thecodecentral.com/2007/09/13/easy-json-encodingdecoding-in-php#comment-2463</guid>
		<description>&lt;pre&gt;
{"job_Description":"My Job","job_Notes":"My jobs notes are here."} 
&lt;/pre&gt;
Unable to post json string ?</description>
		<content:encoded><![CDATA[<pre>
{&quot;job_Description&quot;:&quot;My Job&quot;,&quot;job_Notes&quot;:&quot;My jobs notes are here.&quot;}
</pre>
<p>Unable to post json string ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://thecodecentral.com/2007/09/13/easy-json-encodingdecoding-in-php#comment-2462</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Tue, 18 Dec 2007 04:22:10 +0000</pubDate>
		<guid isPermaLink="false">http://thecodecentral.com/2007/09/13/easy-json-encodingdecoding-in-php#comment-2462</guid>
		<description>{"job_Description":"My Job","job_Notes":"My jobs notes are here."}</description>
		<content:encoded><![CDATA[<p><a href="http://"My+Job","job_Notes":"My+jobs+notes+are+here."">job_Description</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jason</title>
		<link>http://thecodecentral.com/2007/09/13/easy-json-encodingdecoding-in-php#comment-2461</link>
		<dc:creator>Jason</dc:creator>
		<pubDate>Tue, 18 Dec 2007 04:20:38 +0000</pubDate>
		<guid isPermaLink="false">http://thecodecentral.com/2007/09/13/easy-json-encodingdecoding-in-php#comment-2461</guid>
		<description>here's my jquery script : // I should get an alert object if it works?
but in firebug all I get is invalid label.

 var url = "http://127.0.0.1/projects/client_api/test?callback=?";
 $.getJSON(url,
        function(data){
                        alert(data);
        });

heres the json that I'm  getting using zend_json:

{"job_Description":"My Job","job_Notes":"My jobs notes are here."}

and here's the php in case it helps

        $json = new Zend_Json();
        $job_data = array(
            'job_Description' =&#62; 'My Job' ,
            'job_Notes' =&#62; 'My jobs notes are here.');

        echo $json-&#62;encode($job_data);</description>
		<content:encoded><![CDATA[<p>here's my jquery script : // I should get an alert object if it works?<br />
but in firebug all I get is invalid label.</p>
<p> var url = "http://127.0.0.1/projects/client_api/test?callback=?";<br />
 $.getJSON(url,<br />
        function(data){<br />
                        alert(data);<br />
        });</p>
<p>heres the json that I'm  getting using zend_json:</p>
<p><a href="http://"My+Job","job_Notes":"My+jobs+notes+are+here."">job_Description</a></p>
<p>and here's the php in case it helps</p>
<p>        $json = new Zend_Json();<br />
        $job_data = array(<br />
            'job_Description' =&gt; 'My Job' ,<br />
            'job_Notes' =&gt; 'My jobs notes are here.');</p>
<p>        echo $json-&gt;encode($job_data);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Cuong</title>
		<link>http://thecodecentral.com/2007/09/13/easy-json-encodingdecoding-in-php#comment-2419</link>
		<dc:creator>Cuong</dc:creator>
		<pubDate>Thu, 13 Dec 2007 18:18:23 +0000</pubDate>
		<guid isPermaLink="false">http://thecodecentral.com/2007/09/13/easy-json-encodingdecoding-in-php#comment-2419</guid>
		<description>can you post the JSON string you were trying to parse and the jQuery code you used?</description>
		<content:encoded><![CDATA[<p>can you post the <span class="caps">JSON </span>string you were trying to parse and the jQuery code you used?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
