修改Ajax文件上传插件

时间:2013-07-14 14:33:50

标签: jquery ajax

我正在尝试修改此jQuery插件:http://tutorialzine.com/2013/05/mini-ajax-file-upload-form/ 我要做的是:当图像上传完成后,我想显示图像而不是进度条。

在script.js中有这个函数:

progress: function(e, data){

    // Calculate the completion percentage of the upload
    var progress = parseInt(data.loaded / data.total * 100, 10);

    // Update the hidden input field and trigger a change
    // so that the jQuery knob plugin knows to update the dial
    data.context.find('input').val(progress).change();

    if(progress == 100){
        data.context.removeClass('working');
    }
}

所以代替进度条,我可以显示一些文字:

    if(progress == 100){
        data.context.removeClass('working');
     $('.test').html('test');
    }

但我需要的是放一个url,所以我想在progress函数中添加一个参数,但是我到处搜索,我看不到调用progress函数的位置。 有人可以帮我吗?

0 个答案:

没有答案
相关问题