我能否在以下发言中发表一些意见?Json Json (Json Json) (Json Json Json) (Json Json) Json Json (Json Json) Json (Json) Json (Json) Json (Json) Json (Json) Json (Json) Json (Json) Json(Json) Json (Json) Json (Json) Json(Json) Json (Json) Json如果有,如何处理?
当前回答
否 无表格、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、表格评论、//…
或/*…*/
在 JSON 中不允许 。 此答案基于 :
- https://www.json.org
- RFC 4627: 变化:
application/json
JavaScript 对象标记( JSON) 的介质类型 - RFC 8259JavaScript 对象标记(JSON)数据交换格式(取代RFCs 4627、7158、7159)
其他回答
json speces 不支持评论, 但是您可以用键来写评论来解决这个问题, 像这样 。
{
"// my own comment goes here":"",
"key1":"value 1",
"// another comment goes here":"",
"key 2": "value 2 here"
}
我们使用评论文本作为关键, 以确保它们( 几乎) 是独一无二的, 它们不会打破任何解析器。 如果有些评论不是独一无二的, 请在结尾处添加随机数字 。
如果您需要分析任何处理中的评论, 比如剥除这些评论, 您可以用文字填充注释值, 表示它是一个注释 , 比如 :
{
"// my own comment goes here" : "_comment",
"key1":"value 1",
"// another comment goes here" : "_comment",
"key 2": "value 2 here"
}
以此方式, 分析者可以找到所有的评论并处理它们 。
叹气,为什么不只添加字段,例如:
{
"note1" : "This demonstrates the provision of annotations within a JSON file",
"field1" : 12,
"field2" : "some text",
"note2" : "Add more annotations as necessary"
}
只要确保你的"笔记本"名字 不要与任何真正的田地冲突。
你,你,你能够有评论意见的年份贾索普我只是花了一个小时 试图让程序与例如,Highcharts的这个例子.
如果你跟着链接,你会看到
?(/* AAPL historical OHLC data from the Google Finance API */
[
/* May 2006 */
[1147651200000,67.79],
[1147737600000,64.98],
...
[1368057600000,456.77],
[1368144000000,452.97]
]);
因为我在本地文件夹里也有类似的文件 没有问题同源政策所以我决定使用纯JSON... 当然,$.getJSON
由于这些评论而无声无息地失败。
最后,我刚刚向上述地址发送了 HTTP 手动请求, 并意识到内容类型是text/javascript
自此, JSONP 返回纯 JavaScript 。允许但我的应用程序返回了内容类型application/json
所以我不得不去掉那些评论
您可以使用JSON-LD (JSON-LD)和schema.org 注释用于正确写入备注:
{
"https://schema.org/comment": "this is a comment"
}
推荐文章
- 如何合并2 JSON对象从2个文件使用jq?
- 在VS Code中禁用“Comments are not allowed In JSON”错误
- 如何在Kotlin解析JSON ?
- JSON文件的蒙古导入
- 如何用jQuery / JavaScript解析JSON数据?
- jQuery在请求体中发布有效的json
- 将JSON显示为HTML
- Swift:理解// MARK
- 在JSON键名中哪些字符是有效的/无效的?
- 如何JSON序列化集?
- 如何检查JSON键是否存在?
- 在构建中编写注释的语法是什么?gradle文件?
- 将对象序列化为JSON
- node.js TypeError:路径必须是绝对路径或指定根路径到res.sendFile[解析JSON失败]
- Python json。loads显示ValueError:额外数据