manageAjax jquery plugin
来源:互联网 发布:南京java培训 编辑:程序博客网 时间:2024/05/16 06:09
$.manageAjax.create (uniqueName, options)
Creates a new ajaxmanager and returns it. Takes a list of options:
- normal jQuery-Ajax-Options
- queue: (true|false|'clear')the queue-type specifies the queue-behaviour. The clear option clearsthe queue, before it adds a new ajax-task to the queue (last in firstout)
- abortOld (true|false: aborts all "older" requests, if there is a response to a newer request
- maxRequests: (number (1)) limits the number of simultaneous request in the queue.
- preventDoubbleRequests (true|false): prevents multiple equal requests (compares url, data and type)
- cacheResponse (true|false): caches the response data of succesfull responses (The cache will affect all Ajaxmanagers)
Your constructed ajaxmanager knows the following methods:
- add: ([uniqueName], options) returns an id of your XHR object and takes the following options:
- normal jQuery-Ajax-Options
- 'abort' ([function]): a function that will be called, if the request is aborted
- clear: ([uniqueName], [shouldAbort: true|false]) Clears the ajax queue of waiting requests. If the second parameter is true, all requests in proccess will be aborted, too.
- abort:([uniqueName], [id]) Aborts all managed XHR-requests. If you pass theoptional index number of your XHR object only this XHR will be aborted.
- getXHR: ([uniqueName], id) Returns the XHR-Object, if it is already constructed or the queue-function
Note:
First you have to construct/configure a new Ajaxmanager
//create an ajaxmanager named someAjaxProfileName
var someManagedAjax = $.manageAjax.create('someAjaxProfileName', {
queue: true,
cacheResponse: true
});
You have two different ways to call your methods (don´t mix them).
Calling Ajaxmanager with uniqueName
//and add an ajaxrequest
$.manageAjax.add('someAjaxProfileName', {
success: function(html) {
$('ul').append('<li>'+html+'</li>');
},
url: 'test.html'
});
Calling Ajaxmanager with the returned ajaxmanger-Object
//and add an ajaxrequest with the returned object
$.manageAjax.add({
success: function(html) {
$('ul').append('<li>'+html+'</li>');
},
url: 'test.html'
});
Example:
//create an ajaxmanager named cacheQueue
var ajaxManager = $.manageAjax.create('cacheQueue', {
queue: true,
cacheResponse: true
});
//and add an ajaxrequest with the returned object
ajaxManager.add({
success: function(html) {
$('ul').append('<li>'+html+'</li>');
},
url: 'test.html'
});
or only with the uniqueName parameter
//generate an ajaxmanger named clearQueue
$.manageAjax.create('clearQueue', {queue: 'clear', maxRequests: 2});
//and add an ajaxrequest with the name parameter
$.manageAjax.add('clearQueue', {
success: function(html) {
$('ul').append('<li>'+html+'</li>');
},
url: 'test.html'
});
- manageAjax jquery plugin
- jquery plugin
- jquery plugin
- jQuery 对话框 jQuery.plugin
- jQuery / jQuery mvc plugin
- jQuery Form Plugin
- jQuery - plugin插件 - Cookie
- jQuery BlockUI Plugin
- Jquery for table plugin
- Jquery plugin 大全
- Jquery plugin 大全
- jQuery Plugin Container
- jQuery Image Annotation Plugin
- jQuery Form Plugin
- jQuery plugin: Treeview
- jQuery BlockUI Plugin
- jQuery TableSorter Plugin
- jquery lightBox plugin
- XP下建立安全策略-模拟网络错误
- HTTP 1.1 协议详解
- 多路归并排序【JAVA实现】
- HTTP/1.1 Cache-Control的理解(转)
- 靠
- manageAjax jquery plugin
- symbian程序运行时切换本地化动态多语言
- 局域网内通过机器名访问其他机器
- 青梅煮酒论开发者之软实力
- Oracle导出数据和表结构方法
- 正则表达式
- PowerDesigner教程系列(转载)
- winpe安装iso系统(windows系统)文件
- Hibernate+spring+struts包冲突问题!