javascript - JS request error: Unexpected token T in JSON at position 0
PHP中文网
PHP中文网 2017-06-26 10:53:23
0
3
993

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

PHP中文网
PHP中文网

认证0级讲师

reply all(3)
漂亮男人

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

黄舟

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

仅有的幸福

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template