[jQuery] onLoading and onComplete Event Methods in JQuery

[jQuery] onLoading and onComplete Event Methods in JQuery


Hi All,
I am new to Jquery , i implemented the Ajax request in my web
application using prototype.js but because of some issues i need to
replace prototype.js with jquery so i gone through the jquery
documentation but i did not found any replacement for the onLoading of
prototype.js
My Current code implementation in prototype.js is
pars += 'postId=' + postId;
pars += '&comment=' + comment;
pars += '&postauthor=' + postauthor;
var myAjax = new Ajax.Request(
url,
{
method: 'post',
parameters: pars,
onLoading: function(){
var successmsgDiv = $
(successmsg);
successmsgDiv.style.display =
"block";
successmsgDiv.innerHTML =
'<img src="<?php echo site_url(); ?>/processing1.gif" BORDER="0"
alt="processing" />';
$(buttonId).disabled = true;
},
onComplete: function(transport){
var successmsgDiv = $
(successmsg);
successmsgDiv.update
(transport.responseText).setStyle({display:'block'});
frmId.elements
['txtcomment'].value = "";
var postDiv = $
(postcommentdiv);
postDiv.style.display="none";
$(buttonId).disabled = false;
}
}
);
Can any body help me how to do this in jquery.
Any help or suggestion would be greatly appriciated.
Thanks
Gaurav