我试图展示由 jQuery 表单插件处理的上传进度,正如他们在他们的网站上演示的那样。无论我尝试什么,我都无法显示上传进度的百分比,并且[jquery.form] state = uninitialized
在文件上传时,Firebug 会显示在控制台中。上传完成后,Firebug 显示[jquery.form] state = loading
jquery.form.js (line 904)
[jquery.form] isXml=false
这是我的 Javascript。后端使用 class.upload.php、www.verot.net/php_class_upload.htm,完成后返回 JSON。
$("#apparatusPhotoUpload").ajaxForm({
beforeSend: function() {
//Do things such as disable upload button, switch to default preview image
},
uploadProgress: function(event, position, total, percentComplete) {
var progress = percentComplete;
$("#uploadProgress").html(progress);
},
dataType: 'json',
success: function(data) {
//Fire a couple of functions that alter data in the DOM
}
任何帮助,将不胜感激!