简体   繁体   中英

JSONLINT: Parse error on string

I'm trying to verify the following JSON on www.jsonlint.com: http://s2g.supsi.ch/hcd/test.json

If I copy and paste the text in jsonlint the JSON is verified. However if I enter the JSON URL ( http://s2g.supsi.ch/hcd/test.json ) to jsonlint I receive the following error:

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

I don't understand why it doesn't work. Could be the text encoding?

Here is the code which reads the URL:

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

Here is the issue:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM