Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有任何功能可以让我们知道一个组是否有孩子?因为如果我在没有孩子的组中尝试像 Mygroup.getChildren() 一样,我会得到错误。谢谢
请检查这个小提琴
http://jsfiddle.net/LvCmT/
if(group.getChildren().length==0) { alert("group doesn't has children"); } else { //do ur stuff }
if($(Mygroup).children().length==0) { alert("group doesn't has children"); } else { //do your stuff }