空JSON对象检查 [英] Empty JSON Object check
本文介绍了空JSON对象检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我进行控制台打印时,我得到var a的值作为Object {},它是空的JSON对象 使用jQuery如何检查空值? 谢谢.
When I console print I get value of var a as Object{}, which is empty JSON Object Using jQuery how do I check for the empty value? Thank you.
推荐答案
使用jQuery函数:
Use the jQuery function:
jQuery.isEmptyObject( object )
此处有更多详细说明: http://api.jquery.com/jQuery.isEmptyObject/
More detailed description here: http://api.jquery.com/jQuery.isEmptyObject/
就像我一直说的那样...并坚持下去.程序员的第一条规则:
As I always say... and insist on it. Rule number one of the programmer:
手册页是您最好的朋友",或者我在学校里被打的那一页"F1在那里是有原因的"
"Man pages are your best friend" or the one I was slapped with in school "F1 is there for a reason"
这篇关于空JSON对象检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文