1

jQueryUI ダイアログ ウィジェットの内部メソッドをオーバーライドしたい。この例では、「console.log('button');」のみを追加しています。元の関数に
これは私のコードです:

$.extend($.ui.dialog.prototype, 
    {   
        _createButtons: function() {
            console.log('button');
            var e = this, i = this.options.buttons;
            return this.uiDialogButtonPane.remove(), this.uiButtonSet.empty(), t.isEmptyObject(i) || t.isArray(i) && !i.length ? (this.uiDialog.removeClass("ui-dialog-buttons"), undefined) : (t.each(i, function(i, s) {
                var n, a;
                s = t.isFunction(s) ? {click: s,text: i} : s, s = t.extend({type: "button"}, s), n = s.click, s.click = function() {
                    n.apply(e.element[0], arguments)
                }, a = {icons: s.icons,text: s.showText}, delete s.icons, delete s.showText, t("<button></button>", s).button(a).appendTo(e.uiButtonSet)
            }), this.uiDialog.addClass("ui-dialog-buttons"), this.uiDialogButtonPane.appendTo(this.uiDialog), undefined)
        }
    }
);

「Uncaught ReferenceError: t is not defined」というエラーが表示され
ます。何が問題なのですか? または、タスクを実行する適切な方法は何ですか?

4

1 に答える 1

0

だから、それは簡単でした: jquery_ui.js 内で t は jQuery に使用されます

var t = $;
于 2013-11-13T16:09:51.207 に答える