通过Ajax我收到来自PHP脚本编码的JSON字符串(json_encode):报价在jQuery.parseJSON
response = "{"type":"ok","mess":"File successfuly uploaded"}"
,当我试图解析这个字符串jQuery.parseJSON(response);
JS脚本失败堂妹在启动双引号并最终。
正常工作:
jQuery.parseJSON('{"type":"ok","mess":"File successfuly uploaded"}');
如何解决这个问题呢?
我总是收到语法错误: “UNEXPECTED_TOKEN”
解决:原因是不正确的文件编码。 UTF-8没问题
试图逃逸引号` “{\” 类型\” ...` – 2011-10-17 12:19:45