Search This Blog

Sunday, September 26, 2010

Get json object without JSON.parse?

Programmer Question

I found this:



Use Python output:



print �Content-type: text/x-json\n\n�
print json.dumps([{'title':arr['title']}])


and get json string with Jquery:



$ajax(   
success: function(msg){
if(msg[0].title) alert(msg[0].title);
}
)


It works, who can tell me why it is? Thanks~



Find the answer here

No comments:

Post a Comment

Related Posts with Thumbnails