【问题标题】:What is wrong with my json in context of jQuery.jsonParse?在 jQuery.jsonParse 的上下文中我的 json 有什么问题?
【发布时间】:2011-04-01 21:24:14
【问题描述】:

我收到一组 json 的“无效 json”异常。我在验证器中测试了 json。我已将 json 放在 php 文件中,并将标头设置为“contenttype:application/json; charset=utf-8”。

不确定还有什么可能是罪魁祸首。我在这里有我的 jsfiddle:jsfiddle

【问题讨论】:

  • 应该是content-type:application/json; charset=utf-8,在contenttype 之间加上一个破折号,最后没有一个点。

标签: php json parsing exception


【解决方案1】:

$.parseJSON 不加载 URL,您将其传递给 json 字符串。你要找的函数是$.getJSON

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-11-09
    • 2016-05-22
    • 2014-07-15
    • 1970-01-01
    • 1970-01-01
    • 2015-01-02
    • 1970-01-01
    • 2014-06-26
    相关资源
    最近更新 更多