联系我们
简单又实用的WordPress网站制作教学
当前位置:网站首页 > 网页前端技术 > 正文

jquery isType() 类型判断代码 - Web前端

作者:98wpeu发布时间:2026-06-25分类:网页前端技术浏览:3


导读:复制代码代码如下:class2type={};toString=Object.prototype.tostring;type:function(obj){r...
复制代码 代码如下:
class2type = {};
toString = Object.prototype.tostring;
type: function( obj ) {
return obj == null ?
String( obj ) :
class2type[ toString.call(obj) ] || "object";
},

isFunction: function( obj ) {
return JQuery.type(obj) === "function";
},

isArray: array.isArray || function( obj ) {
return jQuery.type(obj) === "array";
},

// A CRUDe way of determining if an object is a window
isWindow: function( obj ) {
return obj && typeof obj === "object" && "SetInterval" in obj;
},

isNaN: function( obj ) {
return obj == Null || !rdigit.test( obj ) || isNaN( obj );
},

标签:类型代码WebisTypejquery


网页前端技术排行
最近发表
网站分类
标签列表