ajax链式操做javascript
var jqxhr = $.ajax( "example.php" ) .done(function() { alert("success"); }) .fail(function() { alert("error"); }) .always(function() { alert("complete"); });
页面元素操做php
$("p").removeClass("myClass noClass").addClass("yourClass"); $("ul li:last").addClass(function(index) { return"item-" + index; }); $('.container').append($('h2'));
jQuery一共13个模块,java
// 核心方法
// 回调系统
// 异步队列
// 数据缓存
// 队列操做
// 选择器引
// 属性操做
// 节点遍历
// 文档处理
// 样式操做
// 属性操做
// 事件体系
// AJAX交互
// 动画引擎ajax
从2.1版开始jQuery支持经过AMD模块划分,jQuery在最开始发布的1.0版本是很简单的,只有CSS选择符、事件处理和AJAX交互3大块。其发展过程当中,有几回重要的变革:浏览器
☑ 1.2.3 版发布,引入数据缓存,解决循环引用与大数据保存的问题
☑ 1.3 版发布,它使用了全新的选择符引擎Sizzle,在各个浏览器下全面超越其余同类型JavaScript框架的查询速度,程序库的性能也所以有了极大提高
☑ 1.5 版发布,新增延缓对像(Deferred Objects),并用deferred重写了Ajax模块
☑ 1.7 版发布,抽象出回调对象,提供了强大的的方式来管理回调函数列表。缓存
jQuery文档针对业务层的Ajax的处理提供了一系列的门面接口:
.ajaxComplete()
.ajaxError()
.ajaxSend()
.ajaxStart()
.ajaxStop()
.ajaxSuccess()架构
底层接口:
jQuery.ajax()
jQuery.ajaxSetup()app
快捷方法:
jQuery.get()
jQuery.getJSON()
jQuery.getScript()
jQuery.post()框架
// jQuery的写法 var $jQuery = function(selector, context) { return new $jQuery.fn.init(selector, context); } $jQuery.fn = $jQuery.prototype = { init: function() { this.name = 'aaron' return this; }, constructor: $jQuery } var $a = $jQuery(); console.log('$jQuery的调用') console.log($a);