JSON.parse错误#1132:无效的JSON解析输入(的Flex /动作脚本/ PHP) [英] JSON.parse Error #1132: Invalid JSON parse input (Flex / Actionscript / PHP)

查看:2302
本文介绍了JSON.parse错误#1132:无效的JSON解析输入(的Flex /动作脚本/ PHP)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到错误#1132:无效的JSON解析输入和无法理解为什么

I am getting "Error #1132: Invalid JSON parse input" and cannot understand why.

我的JSON是由PHP生成。 如果显示在文本区(柔性)输出JSON表明这一点:

My json is generated by php: json_encode($x). Output json if displayed in TextArea(flex) shows this:

{
   "title":"The Incredibles",
   "year":"2004",
   "type":"movie",
   "id":"9806",
   "imdb_id":"tt0317705",
   "rating":8.6,
   "tagline":"No gut, no glory",
   "overview":"Bob Parr has given up his superhero days to log in time as an insurance adjuster and raise his three children with his formerly heroic wife in suburbia. But when he receives a mysterious assignment, it\\'s time to get back into costume.",
   "runtime":115,
   "budget":92000000,
   "image":"http:\/\/cf2.imgobject.com\/t\/p\/w185\/jjAgMfj0TAPvdC8E5AqDm2BBeYz.jpg",
   "trailer":"rMfrFG_69zM"
}

我验证了几个验证器和所有的人说,它是有效的JSON。

I validated with several validators and all of them say it's valid json.

在Flex端我试图访问JSON与此code:

On the flex side I am trying to access json with this code:

JSON.parse(event.result.toString());

但得到的错误。有没有人有这个问题?

but get the error. Has anyone had this problem?

编辑1:

看来,概述线是那里的问题,但我不知道到底为什么,因为我用的php json_en code,应正确逃生的事情......

It seems that the overview line is where the issue is but I dont understand why exactly since I used php json_encode which should escape things correctly...

推荐答案

的转义序列\\出现终止JSON。

它\\的它\的如果你想是。

由于此JSON使用的字符串,它可能只是:

Since this JSON uses " for strings, it could just be: it's.

JSON:

{
   "title":"The Incredibles",
   "year":"2004",
   "type":"movie",
   "id":"9806",
   "imdb_id":"tt0317705",
   "rating":8.6,
   "tagline":"No gut, no glory",
   "overview":"Bob Parr has given up his superhero days to log in time as an insurance adjuster and raise his three children with his formerly heroic wife in suburbia. But when he receives a mysterious assignment, it\'s time to get back into costume.",
   "runtime":115,
   "budget":92000000,
   "image":"http:\/\/cf2.imgobject.com\/t\/p\/w185\/jjAgMfj0TAPvdC8E5AqDm2BBeYz.jpg",
   "trailer":"rMfrFG_69zM"
}

这篇关于JSON.parse错误#1132:无效的JSON解析输入(的Flex /动作脚本/ PHP)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆