jquery Programming Glossary: xhr.addeventlistener
Possible to calculate how much data been loaded with AJAX? http://stackoverflow.com/questions/10559264/possible-to-calculate-how-much-data-been-loaded-with-ajax XHR object by adding the following option to .ajax xhr function var xhr .ajaxSettings.xhr call the original function xhr.addEventListener 'progress' function e if e.lengthComputable var percentComplete e.loaded e.total Do something with download progress ..
Uploading Image to Amazon s3 with HTML, javascript & jQuery with Ajax Request (No PHP) http://stackoverflow.com/questions/11240127/uploading-image-to-amazon-s3-with-html-javascript-jquery-with-ajax-request-n SIGNATURE' fd.append file file var xhr getXMLHTTPObject xhr.upload.addEventListener progress uploadProgress false xhr.addEventListener load uploadComplete false xhr.addEventListener error uploadFailed false xhr.addEventListener abort uploadCanceled false.. xhr.upload.addEventListener progress uploadProgress false xhr.addEventListener load uploadComplete false xhr.addEventListener error uploadFailed false xhr.addEventListener abort uploadCanceled false xhr.open 'POST' 'https yourbucket .s3.amazonaws.com.. uploadProgress false xhr.addEventListener load uploadComplete false xhr.addEventListener error uploadFailed false xhr.addEventListener abort uploadCanceled false xhr.open 'POST' 'https yourbucket .s3.amazonaws.com ' true MUST BE LAST LINE BEFORE YOU SEND..
jQuery Upload Progress and AJAX file upload http://stackoverflow.com/questions/4856917/jquery-upload-progress-and-ajax-file-upload function e var file this.files 0 var xhr new XMLHttpRequest xhr.file file not necessary if you create scopes like this xhr.addEventListener 'progress' function e var done e.position e.loaded total e.totalSize e.total console.log 'xhr progress ' Math.floor done..
File API File Upload - Read XMLHttpRequest in ASP.NET MVC http://stackoverflow.com/questions/5181789/file-api-file-upload-read-xmlhttprequest-in-asp-net-mvc function evt if evt.lengthComputable progressBar.style.width evt.loaded evt.total 100 false File uploaded xhr.addEventListener load function progressBarContainer.className uploaded progressBar.innerHTML Uploaded false xhr.open post home UploadFile..
|