我解析JSON字符串使用jQuery parseJSON
var jsontest = '[{"nombre":"Campa\u00f1a de prueba","parcelas":"10","stampCreacion":"2014-12-30 18:18:26","estado":"1","id":"1","active":"1","camposControl":[{"nombre":"Repetici\u00f3n","tipo":"2","id":"2","active":"1"},{"nombre":"Comentarios","tipo":"1","id":"3","active":"1"}]},{"nombre":"Campa\u00f1a2","parcelas":"10","stampCreacion":"2014-12-30 20:07:36","estado":"1","id":"2","active":"1","camposControl":[{"nombre":"Opciones","tipo":"3","id":"16","active":"1","opciones":[{"nombre":"muchas\r","id":"12","active":"1"},{"nombre":"opciones\r","id":"13","active":"1"},{"nombre":"para mi \r","id":"14","active":"1"},{"nombre":"y para ti","id":"15","active":"1"}]},{"nombre":"numerito por aqui","tipo":"2","id":"17","active":"1"}]}]';
var obj = $.parseJSON(jsontest);
這似乎是根據jsonlint一個有效的JSON,但你可能會在看到小提琴它給下一個錯誤:
未捕獲的SyntaxError:意外的標記 - > jQuery的1.11.2.min.js:4
我使用鉻BTW
現在我越來越: 遺漏的類型錯誤:無法使用「在」操作中搜索「694」 [{「農佈雷」:「坎帕納德... 我改變了我的PHP回聲json_encode( $ arr,JSON_UNESCAPED_UNICODE);並解決了這個問題 – user1532587