Can comments be used in JSON?

后端 未结 30 1698
别跟我提以往
别跟我提以往 2020-11-22 02:16

Can I use comments inside a JSON file? If so, how?

30条回答
  •  梦毁少年i
    2020-11-22 02:27

    The Dojo Toolkit JavaScript toolkit (at least as of version 1.4), allows you to include comments in your JSON. The comments can be of /* */ format. Dojo Toolkit consumes the JSON via the dojo.xhrGet() call.

    Other JavaScript toolkits may work similarly.

    This can be helpful when experimenting with alternate data structures (or even data lists) before choosing a final option.

提交回复
热议问题