jQuery.isEmptyObject()
jQuery.isEmptyObject( object ) 返回: Boolean
描述: 檢查對象是否為空(不包含任何屬性)。
-
version added: 1.4jQuery.isEmptyObject( object )
object將要檢查是否為空的對象。
jQuery 1.4 中,這個方法既檢測對象本身的屬性,也檢測從原型繼承的屬性(因此沒有使用hasOwnProperty)。
Example:
Check an object to see if it's empty.
jQuery.isEmptyObject({}) // true
jQuery.isEmptyObject({ foo: "bar" }) // false