Ajaxmanager
Ajaxmanager copied to clipboard
How to use Events/Callbacks?
Hi
I am using Ajaxmanager with uniqueName and I am wondering how to use these enhanced callbacks
for instance how do I use
managerName + 'AjaxStart' (global) event new
would it be
$.manageAjax.AaxStart({ ... });
Does this override the jquery AjaxStart?
Simply bind an event to a dom or the document node:
$('#wrapper')
.bind('profileNameAjaxStart', function(){
$(this).addClass('profileName-is-loading');
})
.bind('profileNameAjaxStop', function(){
$(this).removeClass('profileName-is-loading');
})
;
And then somewhere later do your requests:
$.manageAjax.add('profileName', {
success: function(html) {
$('ul').append('<li>'+html+'</li>');
},
url: 'test.html'
});
So I could bind it
$(document)
as I would with
$(document).ajaxStart()
Is there a difference between yours and ajaxStart?
On 9/13/2011 3:09 PM, Alexander Farkas wrote:
Simply bind an event to a dom node:
$('#wrapper') .bind('profileNameAjaxStart', function(){ $(this).addClass('profileName-is-loading'); }) .bind('profileNameAjaxStop', function(){ $(this).removeClass('profileName-is-loading'); }) ;And then somewhere later do your requests:
$.manageAjax.add('profileName', { success: function(html) { $('ul').append('<li>'+html+'</li>'); }, url: 'test.html' });