1. 每天坚持阅读一定量的的jquery代码,积少成多!加油加油!
    jquery-2.2.19161~9194

    1 if ( typeof define === "function" && define.amd ) { // 注册一个amd模块,如果define是一个函数并define有amd方法
  2. define( "jquery", [], function() { // 定义jquery并返回jquery对象,这里的define是amd加载器里面定义的。
  3. return jQuery; // 要返回jQuery对象
  4. });
  5. }
  6.  
  7. var
  8. // Map over jQuery in case of overwrite
  9. _jQuery = window.jQuery, //把window.jQuery赋值为_jQuery
  10.  
  11. // Map over the $ in case of overwrite
  12. _$ = window.$; //把window.$赋值给_$
  13.  
  14. jQuery.noConflict = function( deep ) { //给jQuery添加一个一个noConflict的匿名函数
  15. if ( window.$ === jQuery ) { //运行这个函数将变量$的控制权让渡第一个实现的库,确保jquery不会与其他库$冲突
  16. window.$ = _$;
  17. }
  18.  
  19. if ( deep && window.jQuery === jQuery ) {
  20. window.jQuery = _jQuery;
  21. }
  22.  
  23. return jQuery;
  24. };
  25.  
  26. // Expose jQuery and $ identifiers, even in
  27. // AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
  28. // and CommonJS for browser emulators (#13566)
  29. if ( typeof noGlobal === strundefined ) {
  30. window.jQuery = window.$ = jQuery; //让window.jquery,window.$和jQuery保持一致的定义
  31. }

jquery源码阅读(1)的更多相关文章

  1. 从jQuery源码阅读看 dom load

    最近两天不忙的时候再回过来研究一下jquery的源码,看到$(document).ready()时,深入的研究了一下dom的加载问题. 我们都知道,window.onload可以解决我们的js执行时机 ...

  2. JQuery源码阅读记录

    新建html文件,在浏览器中打开文件,在控制台输入consoole.log(window);新建html文件,引入JQuery后在浏览器中打开,在控制台同样输入consoole.log(window) ...

  3. jquery源码阅读笔记一

    1. jquery无new的构造函数. 无new的构造函数是怎么实现的.比如我们一般这么用jQuery. $(".test").text(); 但是我们一般是这么写的. var t ...

  4. jquery源码分析学习地址

    http://www.ccvita.com/121.htmljQuery工作原理解析以及源代码示例http://www.cnblogs.com/haogj/archive/2010/04/19/171 ...

  5. jquery 源码分析学习地址

    http://www.ccvita.com/121.htmljQuery工作原理解析以及源代码示例http://www.cnblogs.com/haogj/archive/2010/04/19/171 ...

  6. jQuery.merge 源码阅读

    jQuery.merge(first,second) 概述 合并两个数组 返回的结果会修改第一个数组的内容——第一个数组的元素后面跟着第二个数组的元素. 参数 first:第一个待处理数组,会改变其中 ...

  7. 阅读jQuery源码的18个惊喜

    注释:本文使用$.fn.method指代调用一系列选中的元素的方法.例如,$.fn.addClass,指代$('div').addClass(‘blue’) 或 $('a.active’).addCl ...

  8. jQuery源码:从原理到实战

    jQuery源码:从原理到实战 jQuery选择器对象 $(".my-class"); document.querySelectorAll*".my-class" ...

  9. JQuery源码解析(一)

    写在前面:本<JQuery源码解析>系列是基于一些前辈们的文章进行进一步的分析.细化.修改而写出来的,在这边感谢那些慷慨提供科普文档的技术大拿们. 要查阅JQ的源文件请下载开发版的JQ.j ...

随机推荐

  1. yahoo给出的关于网站优化的建议

    1.使用CDN 内容分发服务器会根据用户的位置选择最近的服务器响应用户的请求,静态资源放在CDN的性能将提升20%左右. 2.设置Expires和Cache-Contral头 将静态资源的过期时间设置 ...

  2. scala 访问权限详解

    private/protected [包名/类名/this] 即可指定变量的作用域.(this代表只有当前实例(即对象)可以访问) 伴生类和伴生对象中的成员可以相互访问. class PackageO ...

  3. python远程批量执行命令

    #!/usr/bin/env python#-*- coding:utf-8 -*- from multiprocessing import Process,Poolimport time,param ...

  4. C3P0连接池参数详解

    <c3p0-config> <default-config> <!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数.Default: 3 --> < ...

  5. C++线程安全的单例模式

    1.在GCC4.0之后的环境下: #include <iostream> using namespace std;template <typename T>class Sing ...

  6. js 循环迭代定时器的执行次数和执行顺序??主要是因为js是单线程

    当定时器运行时即使每个迭代中执行的是setTimeout(.., 0),所有的回调函数依然是在循环结束后才会被执行 for语句开始赋值i=1;settimeout语句1000毫秒后把timer函数加入 ...

  7. 为Array 添加indexOf

    为array赋予属性 if (!Array.prototype.indexOf) { Array.prototype.indexOf = function (elt /*, from*/) { var ...

  8. JavaScript input框输入实时校验

    <html> <head> <meta http-equiv="Content-Type" content="text/html; char ...

  9. CodeForces 696C PLEASE

    快速幂,费马小定理,逆元. 设$dp[n]$表示$n$次操作之后的概率,那么$dp[n] = \frac{{(1 - dp[n - 1])}}{2}$.$1-dp[n - 1]$表示上一次没有在中间的 ...

  10. 网络最大流最短增广路Dinic算法模板

    #include<cstdio> #include<cstring> #include<string> #include<cmath> #include ...