我有一个函数,里面有一些不熟悉的代码。这可行,但我试图分配一个按钮或链接来运行它,正常的 javascript 事件将不起作用。该应用程序基于 jquery 和 jqueryui。
el.prototype.commands.mkdir = function() {
this.disableOnSearch = true;
this.updateOnSelect = false;
this.mime = 'directory';
this.prefix = 'untitled folder';
this.exec = $.proxy(this.fm.res('mixin', 'make'), this);
this.shortcuts = [{
pattern: 'ctrl+shift+n'}];
this.getstate = function() {
return !this._disabled && this.fm.cwd().write ? 0 : -1;
}
}
大家有什么想法吗?
最佳答案
以上是来自elFinder的代码,该代码是开源的,可以在github上找到。 elFinder 有一个功能/按钮可供您执行创建文件夹操作。您还想实现什么目标?
关于javascript - 将按钮的 onclick 分配给 javascript 函数将不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7356319/