复制代码 代码如下: 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 ); },
推荐阅读
kmock javascript 单元测试代码
复制代码 代码如下:(function () { var KMock = window.KMock = function () { } KMock.prototype.setup = function (methodName) { var instance = this; instance[methodName] = { returnAs: function (fn) { in>>>详细阅读
本文标题:jquery isType() 类型判断代码
地址:http://www.17bianji.com/kaifa2/JS/24944.html
1/2 1