通过$your_jq_dom.fileupload({},donf:function...,fail:function..., ...)

得到的只是一个支持上传的控件,当然绑定了各种事件.

传参给url, 使用formData, 这里有个缺点,比如想得到打开文件中的文件的路径,是不可能提前知道的,因此传参有很大的局限性.

解答:https://github.com/blueimp/jQuery-File-Upload/wiki/Submit-files-asynchronously

通过重写add方法,并给data赋予formData属性即可,如下:

$('#fileupload').fileupload({
add: function (e, data) {
$.getJSON('/example/url', function (result) {
data.formData = result; // e.g. {id: 123}
data.submit();
});
}
});

  

或者重写submit方法,同样的也是给data添加formData属性即可,如下:

$('#fileupload').fileupload({
submit: function (e, data) {
var $this = $(this);
$.getJSON('/example/url', function (result) {
data.formData = result; // e.g. {id: 123}
data.jqXHR = $this.fileupload('send', data);
});
return false;
}
});

  

=====

实际数据的处理: data.submit可以触发.

jquery.fileupload.js 杂记的更多相关文章

  1. 另一种图片上传 jquery.fileupload.js

    今天遇到另外一种上传图片方法 用jquery.fileupload.js <input type="file" name="file[]" multipl ...

  2. jQuery FileUpload等插件的使用实例

    1.jQuery FileUpload 需要的js: jquery.js jquery.fileupload.js jquery.iframe-transport.js jquery.xdr-tran ...

  3. jquery.fileupload插件的简易使用日志

    来源:http://yixiandave.iteye.com/blog/1897330 本文内容主要包含fileupload插件传递参数和取回服务器返回数据的方法 jquery.fileupload官 ...

  4. 关于jquery.fileupload结合PHP上传图片的开发用法流程

    这阵子做了一个项目,涉及到了图片上传,以往用的都是uploadify这个插件,感觉它在PC上的使用还是很强大的, 不过最近这个项目涉及到了移动端的上传,其实uploadify也可以,但是他有一个 up ...

  5. jquery.fileupload-image-editor.js

    jquery.fileupload-image-editor.js中 _initEventHandlers: function () { this._super(); var handlers = { ...

  6. [Asp.net mvc]jquery.form.js无刷新上传

    写在前面 最近在自己的网盘项目中想用ajax.beginform的方式做无刷新的操作,提交表单什么的都可以,但针对文件上传,就是个鸡肋.在网上查找了发现很多人都遇到了这个问题,大部分都推荐使用jque ...

  7. 文件上传功能 -- jquery.form.js/springmvc

    距离上一篇 文件上传下载样式 -- bootstrap(http://www.cnblogs.com/thomascui/p/5370947.html)已经三周时间了,期间一直考虑怎么样给大家提交一篇 ...

  8. Jquery ajaxfileupload.js结合.ashx文件实现无刷新上传

    先上几张图更直观展示一下要实现的功能,本功能主要通过Jquery ajaxfileupload.js插件结合ajaxUpFile.ashx一般应用程序处理文件实现Ajax无刷新上传功能,结合NPOI2 ...

  9. jquery.fileupload插件 ie9下不支持上传

    根据https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support The following browsers support ...

随机推荐

  1. α发布后的感想(组长作业)

    今天α发布后,组长作业,谈谈心得体会,谈谈哪些做的好的地方,哪些做的不好.耐撕团队组长因有事缺席,耐撕团队的α发布由齐同学来主持,所以这个作业由齐同学代理. 先谈谈耐撕团队在α发布会中齐同学认为做的好 ...

  2. baidu时光轴_使用window.scroll实现的

    <!DOCTYPE html> <html> <head> <title></title> <meta charset="u ...

  3. Git环境的搭建及使用

    管理工具 1. Git环境的搭建 a.下载Git installer,地址:http://git-scm.com/downloads a1.参考文档地址:http://www.open-open.co ...

  4. Java编程思想学习(五) 复用类

    1.继承与组合 复用类的方法有两种:继承与组合.继承就不多说了,组合就是直接在类中new一个对象. 数组也是对象,使用数组也是组合的一种. 2.初始化基类 当创建一个导出类的对象时,该对象包含一个基类 ...

  5. POJ-1273 Drainage Ditches 最大流Dinic

    Drainage Ditches Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 65146 Accepted: 25112 De ...

  6. Rootkit Hunter Sourcecode Learning

    目录 . Rootkit Hunter Introduce() . Source Code Frame() . do_system_check_initialisation() . do_system ...

  7. C#用UPnP穿透内网

    参考了网上的一篇文章,由于时间长了,具体地址不知道了. 引入了一个DLL: Interop.NATUPNPLib.dll,实现穿透局域网,进行Socket通信. using System; using ...

  8. Codeforces 593B Anton and Lines

    LINK time limit per test 1 second memory limit per test 256 megabytes input standard input output st ...

  9. appium向右滑动

    /*** * 右滑1/2屏幕 / public static void slideRight(){ int x=driver.manage().window().getSize().width; in ...

  10. Eclips将lib打入war中

    在项目的属性, java build path -> Libraries -> Add library.. -> Web app Libraries .即可. 在属性中, Deplo ...