Before the advent of HTML5, the only event listener that was available with XmlHttpRequest
was the readystatechange
event listener. In HTML5, several event listeners have been added to the XmlHttpRequest
interface: loadstart, progress, load, abort, error, timeout, and loadend. In this recipe, we will see the various event listeners that can be attached to the file uploader widget and the sequence in which these events are executed.
The file uploader widget shows you the progress of the files being uploaded and shows the status as completed when all files have been uploaded. However, in many instances, you would like to attach listeners and listen to various events:
$('#fileUpload').kendoUpload({ async: { 'saveUrl': '/fileUploadService/save', 'removeUrl': '/fileUploadService/remove', 'autoUpload': true }, cancel: function () { console.log('Cancel Event.'); }, complete: function () { console.log('Complete Event....