jquery.fileupload-image-editor.js中

  _initEventHandlers: function () {
this._super(); var handlers = {};
handlers[this.options.uploadImageEditorPreviewSelector] = this._previewHandler.bind(this); this._on(this.options.filesContainer, handlers);
},

jquery.ui.widget.js

    _on: function( suppressDisabledCheck, element, handlers ) {
var delegateElement,
instance = this; // no suppressDisabledCheck flag, shuffle arguments
if ( typeof suppressDisabledCheck !== "boolean" ) {
handlers = element;
element = suppressDisabledCheck;
suppressDisabledCheck = false;
} // no element argument, shuffle and use this.element
if ( !handlers ) {
handlers = element;
element = this.element;
delegateElement = this.widget();
} else {
element = delegateElement = $( element );
this.bindings = this.bindings.add( element );
}

遇到错误

是因为找不到

uploadTemplateId: 'template-upload',

Uncaught TypeError: Cannot read property 'innerHTML' of null
at Function.tmpl.load (tmpl.js:38)

tmpl.load = function (id) {
return document.getElementById(id).innerHTML
}

at tmpl (tmpl.js:21)

var tmpl = function (str, data) {
var f = !/[^\w\-.:]/.test(str)
? (tmpl.cache[str] = tmpl.cache[str] || tmpl(tmpl.load(str)))
: new Function( // eslint-disable-line no-new-func
tmpl.arg + ',tmpl',
'var _e=tmpl.encode' +
tmpl.helper +
",_s='" +
str.replace(tmpl.regexp, tmpl.func) +
"';return _s;"
)
return data
? f(data, tmpl)
: function (data) {
return f(data, tmpl)
}
}

at $.<computed>.<computed>._initTemplates (jquery.fileupload-ui.js:657)

_initTemplates: function () {
var options = this.options;
options.templatesContainer = this.document[0].createElement(
options.filesContainer.prop('nodeName')
);
if (tmpl) {
if (options.uploadTemplateId) {
options.uploadTemplate = tmpl(options.uploadTemplateId);
}
if (options.downloadTemplateId) {
options.downloadTemplate = tmpl(options.downloadTemplateId);
}
}
}

at $.<computed>.<computed>._initTemplates (jquery.ui.widget.js:127)
at $.<computed>.<computed>._initSpecialOptions (jquery.fileupload-ui.js:677)

_initSpecialOptions: function () {
this._super();
this._initFilesContainer();
this._initTemplates();
},

at $.<computed>.<computed>._initSpecialOptions (jquery.ui.widget.js:127)
at $.<computed>.<computed>._create (jquery.fileupload.js:1381)

_create: function () {
this._initDataAttributes();
this._initSpecialOptions();
this._slots = [];
this._sequence = this._getXHRPromise(true);
this._sending = this._active = 0;
this._initProgressObject(this);
this._initEventHandlers();
},

at $.<computed>.<computed>._create (jquery.ui.widget.js:127)
at $.<computed>.<computed>._super (jquery.ui.widget.js:114)
at $.<computed>.<computed>._create (jquery.fileupload-process.js:167)

_create: function () {
this._super();
this._processing = 0;
this._processingQueue = $.Deferred().resolveWith(this)
.promise();
}

扩展阅读

https://api.jqueryui.com/jQuery.widget/#method-_on

_on( [suppressDisabledCheck ] [, element ], handlers )Returns: jQuery (plugin only)

Binds event handlers to the specified element(s). Delegation is supported via selectors inside the event names, e.g., "click .foo". The _on() method provides several benefits of direct event binding:

  • Maintains proper this context inside the handlers.
  • Automatically handles disabled widgets: If the widget is disabled or the event occurs on an element with the ui-state-disabled class, the event handler is not invoked. Can be overridden with the suppressDisabledCheck parameter.
  • Event handlers are automatically namespaced and cleaned up on destroy.
  • suppressDisabledCheck (default: false)
    Type: Boolean
    Whether or not to bypass the disabled check.
  • element
    Type: jQuery
    Which element(s) to bind the event handlers to. If no element is provided, this.element is used for non-delegated events and the widget element is used for delegated events.
  • handlers
    Type: Object
    An object in which the keys represent the event type and optional selector for delegation, and the values represent a handler function to be called for the event.
Code examples:

Prevent the default action of all links clicked within the widget's element.

this._on( this.element, {
"click a": function( event ) {
event.preventDefault();
}
});

https://www.runoob.com/jquery/traversing-closest.html

定义和用法

closest() 方法返回被选元素的第一个祖先元素。

祖先是父、祖父、曾祖父,依此类推。

DOM 树:该方法从当前元素向上遍历,直至文档根元素的所有路径(<html>),来查找 DOM 元素的第一个祖先元素。

该方法与 parents() 类似,都是向上遍历 DOM 树,不同点是:

closest()

  • 从当前元素开始
  • 沿 DOM 树向上遍历,并返回匹配所传递的表达式的第一个单一祖先
  • 返回包含零个或一个元素的 jQuery 对象

parents()

  • 从父元素开始
  • 沿 DOM 树向上遍历,并返回匹配所传递的表达式的所有祖先
  • 返回包含零个、一个或多个元素的 jQuery 对象

jquery.fileupload-image-editor.js的更多相关文章

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

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

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

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

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

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

  4. MVC文件上传-使用jQuery.FileUpload和Backload组件实现文件上传

    本篇使用客户端jQuery-File-Upload插件和服务端Badkload组件实现多文件异步上传.MVC文件上传相关兄弟篇: 处理文件上传的服务端组件Backload 用于处理文件上传的服务端组件 ...

  5. 使用jQuery.FileUpload插件和服Backload组件自定义上传文件夹

    在零配置情况下,文件的上传文件夹是根目录下的Files文件夹,如何自定义文件的上传文件夹呢? □ 在web.config中配置 1: <configuration> 2: <conf ...

  6. 使用jQuery.FileUpload和Backload自定义控制器上传多个文件

    当需要在控制器中处理除了文件的其他表单字段,执行控制器独有的业务逻辑......等等,这时候我们可以自定义控制器. 通过继承BackloadController □ 思路 BackloadContro ...

  7. 使用jQuery.FileUpload插件和Backload组件裁剪上传图片

    □ 思路 1.自定义控制器继承Backload的默认控制器BackloadController2.自定义一个jQuery File Upload初始化js文件,使用自定义控制器的方法3.在视图页面调用 ...

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

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

  9. 解决ewebeditor for php在IE8下报editor.js错误的解决方案

    打开editor.js,寻找如下代码: if (element.YUSERONCLICK) eval(element.YUSERONCLICK + "anonymous()"); ...

  10. javascript: jquery.gomap-1.3.3.js

    from:http://www.pittss.lv/jquery/gomap/solutions.php jquery.gomap-1.3.3.js: /** * jQuery goMap * * @ ...

随机推荐

  1. python 利用 smtplib发邮件

    import smtplib from email.mime.text import MIMEText title = "request build error" content ...

  2. 吴恩达机器学习101:SVM优化目标

    1.为了描述SVM,需要从logistic回归开始进行学习,通过改变一些小的动作来进行支持向量机操作.在logistic回归中我们熟悉了这个假设函数以及右边的sigmoid函数,下式中z表示θ的转置乘 ...

  3. 2019-11-29-dotnet-使用-System.CommandLine-写命令行程序

    title author date CreateTime categories dotnet 使用 System.CommandLine 写命令行程序 lindexi 2019-11-29 08:33 ...

  4. LDP - Linux文档工程的简介,包括帮助,向导和文档

    总览 SYNOPSIS Linux文档工程(LDP)为Linux社区提供多种自由文档资源,包括向导 (guide),常见问答 (FAQ),入门 (HOWTO) 以及手册页 (man-pages). 作 ...

  5. Linux系统,无法收到组播消息的问题

    解决办法: 做以下3个修改 1. /etc/sysctl.conf 文件中的 net.ipv4.conf.all.rp_filter 设置成0 2. sysctl -w net.ipv4.conf.a ...

  6. Big Data(四)关于Hadoop的HA&CAP理论详解

    问题 思路: 主从集群:结构相对简单,主与从协作 主:单点,数据一致好掌握 问题: 单点故障,集群整体不可用 压力过大,内存受限 解决方案 单点故障: 高可用方案:HA(High Available) ...

  7. Python深入:编码问题总结

    转自:http://blog.csdn.net/gqtcgq/article/details/47068817 一:字符编码简介          1:ASCII          最初的计算机的使用 ...

  8. Spring加载资源文件的方式

    UrlResource 封装了java.net.URL,它能够被用来访问任何通过URL可以获得的对象,例如:文件.HTTP对象.FTP对象等.所有的URL都有个标准的 String表示,这些标准前缀可 ...

  9. python中split()及os.path模块的使用方法

    返回path规范化的绝对路径path=os.path.abspath('test.py')print(path)输出 D:\Caps\test.pypath=os.path.abspath('D:\\ ...

  10. 当return遇到finally

    http://blog.csdn.net/andymu077/article/details/6649812 在try-catch-finally中, 当return遇到finally: 1.在try ...