I am not sure what you mean by "make the bind" but here is an example
doing what you ask using ajax responders:
Ajax.Responders.register({
onCreate: function(ar)
{
ar.options.onSuccess = ar.options.onSuccess ||
Prototype.emptyFunction;
ar.options.onSuccess = ar.options.onSuccess.wrap(function
(localCB,xhr,xjs)
{
// Do your stuffs here
alert("Apex inboud!");
// Then call the provided callback
localCB(xhr,xjs);
});
}
});
new Ajax.Request('http://jsbin.com/azeyo',{
onSuccess: function(xr) { alert("CB:"+xr.responseText); }
});
You can see it working here: http://jsbin.com/afudi and play with the
code here: http://jsbin.com/afudi/edit
Eric