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 ... */ });
调试器告诉您问题发生在哪一行?这是一个常见错误,特别是如果您对库不是很熟悉的话。如果答案帮助你考虑