var handle = {
onCreate: function() {
// 当创建Ajax请求时,执行的代码
},
onComplete: function() {
if (Ajax.activeRequestCount == 0) {
// 当请求成功返回时,执行的代码
}
}
};
// 将handle注册到全局的Ajax.Responders对象中,使其生效
Ajax.Responders.register(handle);
这就是Prototype.js中的Ajax.Responders对象