modify an Ajax file upload plugin

I'm trying to modify this jQuery plugin: what I'm trying to do is: when the image is done uploading, instead of the progress bar I want to display the image. In script.js there is this function: progress: function(e, data){ // Calculate the completion percentage of the upload var progress = parseInt(data.loaded / * 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'); } } so instead of the progress bar I'm able to display some text: if(progress == 100){ data.context.removeClass('working'); $('.test').html('test'); } but what I need is to put an url, so I want to add a parameter to the progress function, but I searched everywhere and I don't see where the progress function is called. Does anybody can help me please?
If you're looking for the SRC of the file, it's going to be in the e param of the function. I don't know exactly what, just console.log(e), then step through it until you find the SRC of the uploaded image.

以上就是modify an Ajax file upload plugin的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准