search

Home  >  Q&A  >  body text

javascript - JS request error: Unexpected token T in JSON at position 0

This is a request, and an error is reported in the parameters. May I ask why?
I’m puzzled

PHP中文网PHP中文网2818 days ago994

reply all(3)I'll reply

  • 漂亮男人

    漂亮男人2017-06-26 10:55:23

    JSON.parse is used somewhere, but the parameter passed in is not a qualified json string.

    reply
    0
  • 黄舟

    黄舟2017-06-26 10:55:23

    http://www.bejson.com/
    Use this URL to test and see if the json format is incorrect. Line breaks, single quotes, etc. will cause errors. The format requirements are very strict

    The following will cause an error:
    The non-numeric key value in the JSON string does not have double quotes
    There is a tab character like t in JSON, which looks the same as a space, but the verification fails because of its existence. Just remove it and you'll be fine.
    It will also be caused if the editor has BOM

    reply
    0
  • 仅有的幸福

    仅有的幸福2017-06-26 10:55:23

    Look at the format requirements of json. The JSON.parse() method has very strict requirements on json strings

    reply
    0
  • Cancelreply