1、why is jquery
  • Only 32kB minified and gzipped. Can also be included as an AMD module
  • Supports CSS3 selectors to find elements as well as in style property manipulation
  • IE, Firefox, Safari, Opera, Chrome, and more

2、Downloading jQuery using Bower
jQuery is registered as a package with Bower. You can install the latest version of jQuery with the command:
bower install jquery

This will install jQuery to Bower's install directory, the default being bower_components. Within bower_components/jquery/dist/ you will find an uncompressed release, a compressed release, and a map file.
if you wish to install just the compressed jQuery 2.1.0, you can install just that file with the following command:
bower install http://code.jquery.com/jquery-2.1.4.min.js

3、Using jQuery with a CDN
CDNs can offer a performance benefit by hosting jQuery on servers spread across the globe. This also offers an advantage that if the visitor to your webpage has already downloaded a copy of jQuery from the same CDN, it won't have to be re-downloaded.

<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
To see all available files and versions, visit http://code.jquery.com

4、References:
 
5、plugins with AMD
/*==============jquery插件queue.js,符合AMD规范============*/

define( [
"./core",
"./data/var/dataPriv",
"./deferred",
"./callbacks"
], function( jQuery, dataPriv ) { jQuery.extend( {
queue: function( elem, type, data ) {
//...
}, dequeue: function( elem, type ) {
//...
}, // Not public - generate a queueHooks object, or return the current one
_queueHooks: function( elem, type ) {
//...
}
} ); jQuery.fn.extend( {
queue: function( type, data ) {
//...
},
dequeue: function( type ) {
return this.each( function() {
jQuery.dequeue( this, type );
} );
},
clearQueue: function( type ) {
return this.queue( type || "fx", [] );
}, // Get a promise resolved when queues of a certain type
// are emptied (fx is the type by default)
promise: function( type, obj ) {
//...
}
} ); return jQuery;
} ); /*=============core.js==================*/
define( [
"./var/arr",
"./var/document",
"./var/slice",
"./var/concat",
"./var/push",
"./var/indexOf",
"./var/class2type",
"./var/toString",
"./var/hasOwn",
"./var/support",
"./core/DOMEval"
], function( arr, document, slice, concat,
push, indexOf, class2type, toString, hasOwn, support, DOMEval ) { var
version = "@VERSION", // Define a local copy of jQuery
jQuery = function( selector, context ) { // The jQuery object is actually just the init constructor 'enhanced'
// Need init if jQuery is called (just allow error to be thrown if not included)
return new jQuery.fn.init( selector, context );
}, // Support: Android<4.1
// Make sure we trim BOM and NBSP
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, // Matches dashed string for camelizing
rmsPrefix = /^-ms-/,
rdashAlpha = /-([a-z])/g, // Used by jQuery.camelCase as callback to replace()
fcamelCase = function( all, letter ) {
return letter.toUpperCase();
}; jQuery.fn = jQuery.prototype = { // The current version of jQuery being used
jquery: version, constructor: jQuery, // The default length of a jQuery object is 0
length: ,
// Execute a callback for every element in the matched set.
each: function( callback ) {
return jQuery.each( this, callback );
}, map: function( callback ) {
return this.pushStack( jQuery.map( this, function( elem, i ) {
return callback.call( elem, i, elem );
} ) );
}
}; jQuery.extend = jQuery.fn.extend = function() {
//...
}; jQuery.extend( { // Unique for each copy of jQuery on the page
expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), // Assume jQuery is ready without the ready module
isReady: true, error: function( msg ) {
throw new Error( msg );
}
} ); return jQuery;
} );

最新文章

  1. 【转】70个经典的 Shell 脚本面试问题
  2. C#学习之Stream
  3. Java连接MongoDB进行增删改查
  4. Fliwer:监控植物状态 实现远程浇水
  5. 单片机TM4C123学习(十):ADC采样模块
  6. Javascript基础系列之(六)循环语句(while语句)
  7. hdu 3473 裸的划分树
  8. swift 类 结构体 作为参数 以及可变参数
  9. Windows 编程之 对话框总结
  10. IDEA + Maven + JavaWeb项目搭建
  11. Java开发速度神器Lombok,Eclipse端安装使用教程
  12. const函数
  13. input 标签的 disabled 和 readonly 属性
  14. 直接借鉴的 ids拼接
  15. Hive记录-Hive on Spark环境部署
  16. html5 选择多张图片在页面内预览并上传到后台
  17. malloc,calloc,realloc函数用法,原理及不同解析
  18. JDBC结果集
  19. Inside Amazon&#39;s Kafkaesque &quot;Performance Improvement Plans&quot;
  20. JavaWeb基础—EL表达式与JSTL标签库

热门文章

  1. FastReport.net 常用方法
  2. Delphi 的绘图功能[8] - TextOut、TextWidth、TextHeight
  3. Java线程模型
  4. 使用Gulp实现网页自动刷新:gulp-connect
  5. 周记【距gdoi:133天】
  6. CentOS 7 环境搭建kafka集群
  7. BZOJ4071 &amp; 洛谷3644 &amp; UOJ112:[APIO2015]巴邻旁之桥——题解
  8. BZOJ3123:[SDOI2013]森林——题解
  9. Vue_WebPack小白入门
  10. [CodeVs1227]方格取数2(最大费用最大流)