fundamentals of the jQuery library
2016-01-04 21:55
501 查看
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:
This will install jQuery to Bower's install directory, the default being
if you wish to install just the compressed jQuery 2.1.0, you can install just that file with the following command:
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[/code]
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:
http://jquery.com/
https://github.com/jquery/jquery
http://plugins.jquery.com/
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: 0, // 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; } );
相关文章推荐
- jQuery $.extend() 和 $.fn.extend() 用法
- jquery中文api
- jQuery打造动态下滑菜单
- jQuery 自定义鼠标右键菜单
- jquery回车键获取input框焦点
- html中解决jquery多版本冲突问题
- Java 夹杂文本字段的文件上传 后台实现(包括前端jquery实现的备忘)
- jquery 选择器
- jQuery返回顶部实用插件
- jQuery瀑布流实例无限滚动加载图片
- Jquery一个slideToggle搞定div的隐藏与显示
- Jquery-中括号与冒号([]与:)的用法
- Html5添加全屏背景视频jQuery插件教程
- 沫沫金 - 实战总结jQuery进阶技巧图册
- JQuery文件上传插件uploadify在MVC中Session丢失的解决方案
- jquery获取radiobutton的选中值
- jQuery插件之ajaxFileUpload
- 实例详解jQuery结合GridView控件的使用方法
- 大前端------jQuery事件
- jquery中eq和get的区别与使用方法