1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
function titi() {
alert("OUahhhhhh");
var value = Ajax.activeRequestCount;
alert("Avant la sortie :"+value);
alert("Lancement requête myAjaxSynAnoRea");
if(typeof(myAjaxSynAnoRea)=='undefined'){
alert('Variable maVariable indéfinie');
} else {
myAjaxSynAnoRea.abort();
var value = Ajax.activeRequestCount;
alert("Avant la sortie :"+value);
}
alert("Lancement requête myAjaxSynAnoPre");
if(typeof(myAjaxSynAnoPre)=='undefined'){
alert('Variable maVariable indéfinie');
} else {
myAjaxSynAnoPre.abort();
var value = Ajax.activeRequestCount;
alert("Avant la sortie :"+value);
}
}
/**
* Ajax.Request.abort * extend the prototype.js Ajax.Request object so that it supports an abort method
*/
Ajax.Updater.prototype.abort = function() {
// prevent and state change callbacks from being issued
//this.transport.onreadystatechange = Prototype.emptyFunction;
// abort the XHR
//this.transport.abort();
// avoid MSIE/Mozilla calling other event handlers when aborted
this.transport.onreadystatechange = Prototype.emptyFunction;
this.transport.abort();
this._complete = true;
this.aborted = true;
var response = new Ajax.Response(this);
Ajax.Responders.dispatch('onAbort', this, response, response.headerJSON);
// update the request counter
Ajax.activeRequestCount--;
}; |
Partager