Je trouve ceci:Obtenir un objet json sans JSON.parse?
Utilisez la sortie Python:
print ‘Content-type: text/x-json\n\n’
print json.dumps([{'title':arr['title']}])
et obtenir chaîne JSON avec Jquery:
$ajax(
success: function(msg){
if(msg[0].title) alert(msg[0].title);
}
)
Il travaille, qui peut me dire pourquoi il est? Merci ~
merci pour votre réponse ~ medr – Zhaiduo