ajax/json に問題があります
Phpjson_encode()
はこの json コードを生成しました:
[{"createdDate":"2013-08-16 13:23:35","body":"kpk"},
{"createdDate":"2013-08-16 13:20:18","body":"iji"},
{"createdDate":"2013-08-16 13:17:34","body":"kp"},
{"createdDate":"2013-08-16 13:17:16","body":"kp"},
{"createdDate":"2013-08-16 13:15:11","body":"koml"},
{"createdDate":"2013-08-16 13:14:08","body":"lplpp,"},
{"createdDate":"2013-08-16 13:13:59","body":"lplpp,"},
{"createdDate":"2013-08-16 13:10:51","body":"mpmkp"},
{"createdDate":"2013-08-16 13:10:29","body":"ook"},
{"createdDate":"2013-08-16 13:07:48","body":"oomoloo"}]
しかし、予期しないトークンエラーが発生し続けます。誰かが理由を説明できますか?
次の方法で json 文字列を解析しようとすると、エラーがスローされます。
function ajax_callback(mex)
{
mexx = JSON.parse(mex);
//other stuff
}