My code works fine in jquery 1.4 and i try upgrade it to 1.5. But this part of code stop working - its standard beforeSend handler
beforeSend: function (xhr,
If your beforeSend was global:
var oldXHR = jQuery.ajaxSettings.xhr;
jQuery.ajaxSettings.xhr = function() {
var xhr = oldXHR();
if(xhr instanceof window.XMLHttpRequest) {
xhr.upload.addEventListener('progress', on_progress, false);
xhr.upload.addEventListener('load', on_loaded, false);
xhr.addEventListener('abort', on_abort, false);
}
return xhr;
};
If your beforeSend was specific to a particular request:
$.ajax({
xhr: function() {
var xhr = jQuery.ajaxSettings.xhr();
if(xhr instanceof window.XMLHttpRequest) {
xhr.upload.addEventListener('progress', on_progress, false);
xhr.upload.addEventListener('load', on_loaded, false);
xhr.addEventListener('abort', on_abort, false);
}
return xhr;
}
});