| xhr: function() | xhr: function() | ||||
| { | { | ||||
| var xhr = new window.XMLHttpRequest(); | var xhr = new window.XMLHttpRequest(); | ||||
| xhr.upload.addEventListener("progress", function(evt){ | |||||
| xhr.upload.addEventListener("progress", function(evt, x){ | |||||
| if (evt.lengthComputable) { | if (evt.lengthComputable) { | ||||
| var progress = Math.floor(evt.loaded / evt.total * 50); | var progress = Math.floor(evt.loaded / evt.total * 50); | ||||
| if ( progress < 1 ) { progress = 1; } | if ( progress < 1 ) { progress = 1; } | ||||
| if ( progress > 49 ) { progress = 49; } | if ( progress > 49 ) { progress = 49; } | ||||
| console.log("upload_progress_this", this); | |||||
| console.log("upload_progress_this", x); | |||||
| console.log("upload_progress_event", evt); | console.log("upload_progress_event", evt); | ||||
| } | } | ||||
| }, false); | }, false); |