【问题标题】:JSONLINT: Parse error on stringJSONLINT:字符串解析错误
【发布时间】:2015-02-10 08:28:32
【问题描述】:

我正在尝试在 www.jsonlint.com 上验证以下 JSON: http://s2g.supsi.ch/hcd/test.json

如果我将文本复制并粘贴到 jsonlint 中,则验证 JSON。但是,如果我将 JSON URL (http://s2g.supsi.ch/hcd/test.json) 输入到 jsonlint,我会收到以下错误:

Parse error on line 1:
^
Expecting '{', '['

我不明白为什么它不起作用。可能是文本编码?

【问题讨论】:

    标签: json jsonlint


    【解决方案1】:

    这是读取 URL 的代码:

        if (jsonVal.substring(0, 4).toLowerCase() === "http") 
          {
          $.post("proxy.php", {"url": jsonVal}, function (responseObj) 
            {
            $('#json_input').val(responseObj.content);
            validate();
            }, 'json');
    

    问题来了:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-12-16
      • 2013-05-10
      • 1970-01-01
      • 1970-01-01
      • 2014-08-26
      • 2012-07-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多