Skip to content

Instantly share code, notes, and snippets.

View bionicvapourboy's full-sized avatar

Mosè Raguzzini bionicvapourboy

View GitHub Profile
(function addXhrProgressEvent($) {
var originalXhr = $.ajaxSettings.xhr;
$.ajaxSetup({
progress: function() { console.log("standard progress callback"); },
xhr: function() {
var req = originalXhr(), that = this;
if (req) {
if (typeof req.addEventListener == "function") {
req.addEventListener("progress", function(evt) {
that.progress(evt);