Empty JSON Object check

耗尽温柔 提交于 2019-12-12 03:54:59

问题


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.


回答1:


Use the jQuery function:

jQuery.isEmptyObject( object )

More detailed description here: http://api.jquery.com/jQuery.isEmptyObject/

EDIT: As I always say... and insist on it. Rule number one of the programmer:

"Man pages are your best friend" or the one I was slapped with in school "F1 is there for a reason"



来源:https://stackoverflow.com/questions/19432475/empty-json-object-check

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!