This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 遍历数组 | |
| * | |
| */ | |
| function each(arr,fn){ | |
| //检测输入的值 | |
| if(typeof(arr) == 'object' && typeof(fn) == 'function'){ | |
| var Length = arr.length; | |
| if(Length && Length == +Length){ | |
| for(var i=0;i<Length;i++){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 检测是否为数字 | |
| * 兼容字符类数字 '23' | |
| */ | |
| function isNum(ipt){ | |
| return (ipt !== '') && (ipt == +ipt) ? true : false; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 判断对象类型 | |
| * string number array | |
| * object function | |
| * htmldocument | |
| * undefined null | |
| */ | |
| function TypeOf(obj) { | |
| return Object.prototype.toString.call(obj).match(/\s(\w+)/)[1].toLowerCase(); | |
| } |
NewerOlder