08 2011 档案
jQuery1.6 类型判断
摘要:首先定义了全局变量class2type = {};rdigit = /\d/,//正则判断是否是数字toString = Object.prototype.toString;通过jQuery.each,定义class2type的属性和值: jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { class2type[ "[object " + name + "]" ] 阅读全文
posted @ 2011-08-31 16:42 不知道用什么名字 阅读(2846) 评论(0) 推荐(0)
jQuery1.6 jQuery.extend
摘要:jQuery.extend = jQuery.fn.extend = function() { var options, name, src, copy, copyIsArray, clone, target = arguments[0] || {}, i = 1, length = arguments.length, deep = false; if ( typeof target === "boolean" ) {//深度复制 deep = target; target = arguments[1] || {}; i = 2; } if ( typeof target 阅读全文
posted @ 2011-08-30 17:32 不知道用什么名字 阅读(1169) 评论(0) 推荐(0)
jQuery isPlainObject
摘要:第一次看jQuery的源代码,转得好晕,苦逼的isPlainObject, 判断是否为纯粹的对象isPlainObject: function( obj ) { if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {//为空,节点,window对象,非object返回false; return false; } if ( obj.constructor && !hasOwn.call(obj, "constructor" 阅读全文
posted @ 2011-08-30 16:26 不知道用什么名字 阅读(938) 评论(2) 推荐(1)
字符串
摘要:字符串在FF Safari opera chrome下,可以直接当做数组一样来获取某个位置上的值“asdasdasd”[1] //s但是在IE下,得到的值是undefinde 阅读全文
posted @ 2011-08-02 15:28 不知道用什么名字 阅读(132) 评论(0) 推荐(0)