JSON string specification?

in the data sent to me by the background today, a field returns

  MDN--JSON  there is no introduction here 


I haven't seen such a lovely background developer for a long time

Let the backend give you {tags: {"area": "XXX", "industry": "XXX", "kind": "", "other": "XXX"}
or you JSON.parse ('{"area": "XXX", "industry": "XXX", "kind": "other": "XXX"})

in addition, "{" area ":" XXX "," industry ":" XXX "," kind ":"," other ":" XXX "}" what is the wrong syntax


'{"key": "value", "number": 1, "object": {"name": "this is my name"}} 'can be in this format, with numbers in double quotes or without

It is true that

does not specify the format of the JSON string. Json itself is just a string that facilitates data transmission.

your problem is simply a data format error, which belongs to a problem that you don't know about JSON.
and now that the back-end framework is so mature, shouldn't there be a ready-made api conversion? did your back-end classmate write a string to you manually?

the most basic.

  • key must be wrapped in double quotation marks.
  • the last object in the array must not be followed by , .
  • objects are wrapped with { } , and arrays are wrapped with [ ] .
  • other objects are basically the same as those in js.