小白教程
所有教程
关于
Search
172.69.6.127
172.69.6.127
参数设置
贡献
退出
操作
编辑
移动
保护
信息
历史
删除
查看“Misc isplainobject”的源代码
本页内容
上一节:
Misc_isnumeric
下一节:
Misc_iswindow
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
{{DISPLAYTITLE:$.isPlainObject()}}[[Category:jquery ref misc|24]] = jQuery.isPlainObject()方法 = [[jquery ref misc|jQuery 杂项方法]] 判断一个对象是否是纯粹的对象。 <sample title="" desc="" lang="html" hererun="1"> $(function () { function fun( html ){ document.body.innerHTML += "<br>" + html; } fun($.isPlainObject({})); //true fun($.isPlainObject( "test" )); //false fun($.isPlainObject(document.location)); // false ,在 IE 8 中返回 true }) </sample> <run name=""> <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>小白教程(xiaobai.wang)</title> <script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script> </head> <body> <script> $(function () { function fun( html ){ document.body.innerHTML += "<br>" + html; } fun($.isPlainObject({})); fun($.isPlainObject( "test" )); fun($.isPlainObject(document.location)); //在 IE 8 中返回 true }) </script> </body> </html> </run> == 定义和用法 == $.isPlainObject() 函数用于判断指定参数是否是一个纯粹的对象。 '''注意:'''宿主对象(或其它被浏览器宿主环境使用的对象,用来完成ECMAScript的执行环境)难以进行跨平台的特性检测。因此,对于这些对象的实例,$.isPlainObject()在不同的浏览器上可能得出不同的结果。 == 语法 == $.isPlainObject( object ) {| class="table table-striped table-hover" ! 参数 ! 描述 |- | object | 任意类型 需要进行判断的任意值。 |} [[jquery ref misc|jQuery 杂项方法]]
返回至“
Misc isplainobject
”。
上一节:
Misc_isnumeric
下一节:
Misc_iswindow