Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery ui 未捕获类型错误:未定义不是函数_Jquery Ui_Datepicker - Fatal编程技术网

Jquery ui 未捕获类型错误:未定义不是函数

Jquery ui 未捕获类型错误:未定义不是函数,jquery-ui,datepicker,Jquery Ui,Datepicker,我正在做一个传单插件,我的日历有问题 var calen = L.DomUtil.create('div', className, container); calen.href = '#'; L.DomEvent .addListener(calen, 'click', L.DomEvent.stopPropagation) .addListener(calen, 'click', L.DomEvent.preventDefault)

我正在做一个传单插件,我的日历有问题

    var calen = L.DomUtil.create('div', className, container);
    calen.href = '#';
    L.DomEvent
        .addListener(calen, 'click', L.DomEvent.stopPropagation)
        .addListener(calen, 'click', L.DomEvent.preventDefault)
        .addListener(calen, 'click', this._buttonExtendCalendaClicked, this);

    calen.datepicker({
        changeMonth: true,
        changeYear: true,
        altField: '#date-input',
        altFormat: 'mm/dd/yy',
        defaultDate: new Date().getTime()
    });
错误是:UncaughtTypeError:undefined不是函数


我不知道该怎么做

calen
由传单的
DomUtil.create()
初始化,它返回一个
HTMLElement

jqueryui将其小部件定义为jquery插件,因此需要将HTMLElement包装到jquery集合中:

$(calen).datepicker({ /* ... options ... */ });

调试器告诉您问题发生在哪一行?这是一个常见错误,特别是如果您对库不是很熟悉的话。如果答案帮助你考虑