您当前的位置:首页 > 网站建设 > jQuery
| php | asp | css | H5 | javascript | Mysql | Dreamweaver | Delphi | 网站维护 | 帝国cms | React | 考试系统 | ajax | jQuery |

jQuery.type()方法

51自学网 2023-01-08 20:05:54
  jQuery

实例

该参数是否一个正则表达式

这是一个正则表达式? <b></b><script>$(function () { $( "b" ).append( "" + jQuery.type( /test/ ) );})</script>

定义和用法

$.type() 函数用于确定JavaScript内置对象的类型,并返回小写形式的类型名称。

如果对象是undefined或null,则返回相应的"undefined"或"null"

$.type( undefined ) === "undefined"$.type() === "undefined"$.type( window.notDefined ) === "undefined"$.type( null ) === "null"

如果对象有一个内部属性[[Class]]和一个浏览器的内置对象的 [[Class]] 相同,我们返回相应的 [[Class]] 名字。

$.type( true ) === "boolean"$.type( 3 ) === "number"$.type( "test" ) === "string"$.type( function(){} ) === "function"$.type( [] ) === "array"$.type( new Date() ) === "date"$.type( new Error() ) === "error" // jQuery 1.9 新增支持$.type( /test/ ) === "regexp"

语法

$.type( obj )

参数描述
obj任意类型 需要确定类型的任意对象。


下载地址:
jQuery.trim()方法
jQuery.unique()方法
51自学网,即我要自学网,自学EXCEL、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。
京ICP备13026421号-1