(^302) ❘ CHAPTER 11 HTML5 DRAG AND DROP
'progress',
function(event)
{
if (event.lengthComputable)
{
$('div#finderDragAndDropDialogueProgressMeter')
.show();
$('div#finderDragAndDropDialogueProgressMeter div')
.show();
var progress = Math.round(
(event.loaded * 100) / event.total
);
$('div#finderDragAndDropDialogueProgress span')
.text(progress);
$('div#finderDragAndDropDialogueProgressMeter div')
.css('width', progress + '%');
}
},
false
);
this.http.upload.addEventListener(
'load',
function(event)
{
$('div#finderDragAndDropDialogueProgress span')
.text(100);
$('div#finderDragAndDropDialogueProgressMeter div')
.css('width', '100%');
}
);
}
this.http.addEventListener(
'load',
function(event)
{
// This event is fired when the upload completes and
// the server-side script /file/upload.json sends back
// a response.
dragAndDrop.closeProgressDialogue();
// If the server-side script sends back a JSON response,
// this is how you'd access it and do something with it.
var json = $.parseJSON(dragAndDrop.http.responseText);
},
false
);
http://www.it-ebooks.info
elliott
(Elliott)
#1