$.isEmptyObject()

本页内容
上一节: Misc_isarray 下一节: Misc_isfunction

jQuery.isEmptyObject()方法

jQuery 杂项方法

返回数组中指定元素的索引值


示例

$(function () {
    function fun( html ){
        document.body.innerHTML += "<br>" + html;
    }
    fun($.isEmptyObject({})); // true
    fun($.isEmptyObject({ foo: "bar" })); // false
})

定义和用法

$.isEmptyObject() 函数用于检查对象是否为空(不包含任何属性)。

语法

$.isEmptyObject( object )

参数 描述
object object类型 需要进行判断是否为空的对象。

jQuery 杂项方法

上一节: Misc_isarray 下一节: Misc_isfunction
此页面最后编辑于2022年8月19日 (星期五) 11:47。