
jquery源码分析
_王川
屌丝程序员
展开
-
jQuery源码学习笔记:构造jQuery对象
3.1源码结构:(function( window, undefined ) { var jQuery = (function() { // 构建jQuery对象 var jQuery = function( selector, context ) { return new jQuery.fn.init( selector, c原创 2014-06-01 20:41:48 · 1186 阅读 · 0 评论 -
jQuery源码学习:常用正则表达式
常用的数字正则(严格匹配)正则 含义^[1-9]\d*$ 匹配正整数^-[1-9]\d*$ 匹配负整数^-?[1-9]\d*$ 匹配整数 /^(([1-9]\d*)|(0+))$/; 匹配非负整数(正整数 + 0)^-[1-9]\d*|0$ 匹配非正整数(负整数 + 0)/^(([1-9]\d*)|0)\.\d+$/ 匹配正浮点数^-([1-9]\d*\.\d*|0\.\d*[1原创 2014-06-01 19:58:21 · 1421 阅读 · 0 评论 -
jquery1.7.1源码学习
目录:jquery源码学习笔记:总体架构原创 2014-06-01 19:50:34 · 1350 阅读 · 0 评论 -
jQuery源码学习笔记:jQuery.fn.init(selector,context,rootjQuery)代码详解
3.1 源码init: function( selector, context, rootjQuery ) { var match, elem, ret, doc; // Handle $(""), $(null), or $(undefined) //如果selector为空格,!selector为false if (!selector) {原创 2014-06-03 21:37:57 · 4225 阅读 · 0 评论 -
jQuery源码学习笔记:扩展工具函数
// 扩展工具函数jQuery.extend({ // http://www.w3school.com.cn/jquery/core_noconflict.asp // 释放$的 jQuery 控制权 // 许多 JavaScript 库使用 $ 作为函数或变量名,jQuery 也一样。 // 在 jQuery 中,$ 仅仅是 jQuery 的别名,因此即使不使用原创 2014-06-01 20:47:40 · 1382 阅读 · 0 评论 -
jQuery源码学习笔记:总体架构
1.1、自调用匿名函数:(function( window, undefined ) { // jquery code})(window);这是一个自调用匿名函数,第一个括号内是一个匿名函数,第二个括号立即执行,传参是window。1、为什么有自调用匿名函数?通过定义匿名函数,创建了一个“私有”空间,jQuery必须保证创建的变量不能和导入它的程序发生冲突。2、为什么原创 2014-06-01 19:48:57 · 1155 阅读 · 0 评论