I am trying to figure out what exactly the upload attribute does in the XMLHttpRequest
object. It seems to me that with or without it, a xhr
event listener for progress would monitor a xhr.send(file)
.
I looked on W3C and found: "The upload attribute must return the associated XMLHttpRequestUpload object.".
But I don't understand how this ties in with using xhr.upload.addEventListener("progress", progressFunction, false);
since xhr.addEventListener("progress", progressFunction, false);
would do the same thing.
I am asking because I am looking to create custom graphics for the progress of a an upload....I am not going to use HTML5 progress element or jquery. Strictly Javascript for the client side.
If you attach the event to xhr
itself, then it will only update "progress"
when the upload is complete.
There's a difference between the xhr
object, and the object which is used expressly for the upload.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With