使用 javascript 验证 json 字符串
我有这个 json 字符串 {"Table" : [{"subject" : "No Records are There to Display"}]}
。 如果我收到此数据,我想提醒NO Records Found
。任何建议。
注意:我的关键字段可能会相应变化(即,这里是主题
,还有一些类似详细信息
、描述
。
I have this json string {"Table" : [{"subject" : "No Records are there to Display"}]}
.
If i receive this data i want to alert NO Records Found
. Any suggestion.
Note: My key field may vary accordingly (ie) here it is Subject
and some more like Details
,Description
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我会使用 jquery 或任何其他库将 JSON 字符串转换为 JS 对象:
I'd use jquery or any other library to convert the JSON string into a JS object: