`
阅读更多

百度几乎搜不到这些问题,我就用google,有一些英文的回答,我大概往他们说的这个方向走了

 

这个问题主要是由于json的格式出现了问题,首先可以去http://jsonlint.com/检验一下json格式是否正确,如果,提示是  Valid JSON 那么说明你的json格式很有可能使正确的,这个时候就需要考虑其中的有一些空格换行之类的问题了。于是乎,我就在后台,遍历了一遍json,把所有的数据都trim()了一下,就没有问题了。

 

这个东西让我纠结了好久,希望对大家有帮助。另外建议使用google,而不是百度了

 

1
1
分享到:
评论
2 楼 商人shang 2013-05-19  
满手都是炸 写道
google是我们最好的老师 哈哈

是的
1 楼 满手都是炸 2013-05-19  
google是我们最好的老师 哈哈

相关推荐

    JSON2.JS JSON.JS JSON_PARSE.JS

    json2.js: This file creates a JSON property in the global object, if there isn't already one, setting its value to an object containing a stringify method and a parse method. The parse method uses ...

    A fast streaming JSON parsing library in C..zip

    "A fast streaming JSON parsing library in C" 提供了一个高效的方法来处理JSON数据流,尤其适合处理大量或实时的数据。 在C语言中,JSON解析库通常有两种主要的工作模式:SAX(Simple API for XML)风格的流式...

    A tiny JSON library for C++11.

    There are also helper methods Json::dump, to serialize a Json to a string, and Json::parse (static) to parse a std::string as a Json object. It's easy to make a JSON object with C++11's new ...

    Better-Error-message-for-json-parse:如果JSON.parse失败,则应显示错误发生的位置

    该项目的主要目标是为解析JSON数据时可能发生的SyntaxError提供一个不错的错误消息。 例如,解析以下JSON: { "index": 1, "index_start_at": 56, "integer": 6, "float": 11.6816, "name": "Eva", "surname...

    Activiti发布流程报错org.activiti.engine.ActivitiException: Error parsing XML

    郁闷啊,有时候不得不承认,无论是什么事,曾经是好的,到后边未必还是好的,不要拿曾经的种种来判断今天的结果, 前景:之前本地用jeecg(1.7版本)设计流程、发布流程、修改流程,所有的操作都是项目有汉字启动的,...

    AS3 JSON 包

    trace("Error parsing JSON: " + e.message); } } ``` 5. **第三方库** 虽然AS3内置的JSON支持能满足大部分需求,但在处理复杂结构或者需要提高性能时,可能需要使用第三方库,如Zinc JSON库或AS3CoreLib,...

    draw.py,parsing.py,samples.py

    在您提供的信息中,提到了`draw.py`、`parsing.py`和`samples.py`这三个脚本,它们与Bootchart的实现密切相关。 首先,让我们了解一下这些脚本的作用: 1. **draw.py**:这个名字暗示了这是一个用于绘制图表的脚本...

    A reusable framework for parsing JSON in Swift..zip

    本项目"A reusable framework for parsing JSON in Swift"提供了一个可重用的框架,旨在简化这一过程,提高代码的可维护性和效率。 开源项目通常意味着代码公开,允许其他开发者查看、学习甚至改进源代码。Freddy...

    The full error is: java.lang.IllegalState

    标题中的"The full error is: java.lang.IllegalStateException"是一个典型的Java编程错误,通常表示在不合法或不适当的状态下调用了某个方法。这个错误通常暗示程序试图执行一个不能在这个特定时刻执行的操作。让...

    parse-json:解析JSON有更多有用的错误

    解析JSON 解析JSON有更多有用的错误 ...JSONError: Unexpected token } in JSON at position 16 while parsing near '{ "foo": true,}' 1 | { 2 | "foo": true, > 3 | } | ^ */ parseJson ( json

    C++实现的服务器post访问并实现JSON数据流解析

    std::cerr << "Error parsing JSON: " << e.what() << std::endl; } return nlohmann::json(); // 返回空JSON对象,如果解析失败 } // 解析后的JSON数据可以通过键值访问,例如: nlohmann::json parsedJson = ...

    test_json,ios

    print("Error parsing JSON: \(error)") } } ``` 2.2 编码JSON: 相反,如果我们需要将本地数据结构转换为JSON字符串,可以使用`dataWithJSONObject:options:error:`(Objective-C)或`data(withJSONObject:...

    json2 使用方法

    console.error("Error parsing JSON:", error); } ``` 总的来说,`json2.js`是一个非常实用的工具,它使得旧版浏览器也能享受到现代JavaScript的JSON处理功能。无论你是进行数据交互,还是在本地存储用户数据,这...

    JsonRpc-Cpp

    * reply either with success or error code (in case parsing failed, ...). * * JsonRpc-Cpp provides also simple JSON-RPC TCP and UDP server implementations (Json::Rpc::TcpServer and Json::Rpc::Udp...

    asm5.0.jar

    2013-08-12 14:33:37.672:WARN::Nested in org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in URL [file:/E:/cloudwave-core/src/main/...

    JSON解析demo

    console.error("Error parsing JSON:", error); } ``` 五、JSON与其他数据格式的比较 JSON相比XML(Extensible Markup Language)等其他数据交换格式,更简洁、直观,解析速度更快。然而,XML提供了更丰富的结构...

    linters:Tinkoff TSLint,Stylelint和Prettier棉短绒配置

    这包括: 配置和规则配置和规则(不建议使用) 配置配置目录 Parsing error: "parserOptions.project" has been set for @typescript-eslint/parser. TSLint的自定义规则tinkoff-angular-member-ordering tinkoff-...

    Parsing Techniques: A Practical Guide (Monographs in Computer Science)

    Parsing techniques have grown considerably in importance, both in computer science, ie. advanced compilers often use general CF parsers, and computational linguistics where such parsers are the only ...

    Unexpected token c in JSON at position 0 报错信息及解决

    在编程过程中,我们可能会遇到各种错误,其中"Unexpected token c in JSON at position 0"是一个常见的JavaScript解析错误,通常发生在尝试使用`JSON.parse()`函数解析一个预期为JSON格式的字符串时,但该字符串实际...

Global site tag (gtag.js) - Google Analytics