jquery ui datepicker 在 beforeShowDay 出现错误

发布于 2025-01-06 20:20:07 字数 520 浏览 3 评论 0原文

我正在尝试使用 jquery-ui 的日期选择器来实现事件日历。我已经成功安装了日期选择器并且它显示并工作。当我尝试注册 beforeShowDay 处理程序时出现问题。像这样:

$('#datePicker').datepicker({ beforeShowDay : function(){ }} );

我在 jquery-ui -file 中收到以下错误:ba is undefined。 当我在函数中输出某些内容时,前四次它输出,但随后我收到错误。

$('#datePicker').datepicker({ beforeShowDay : function(){ console.log('test') }} );

输出:

// test
// test
// test
// test
// ba is undefined

如果有人知道问题出在哪里,请帮忙。

I'm trying to implement a event calendar using jquery-ui's datepicker. I've successfully installed the datepicker and it shows up and working. the problem appears when I try to register the beforeShowDay handler. Like this:

$('#datePicker').datepicker({ beforeShowDay : function(){ }} );

I receive the following error in jquery-ui -file: ba is undefined.
when I output something int the function, the first four times it outputs but then I receive the error.

$('#datePicker').datepicker({ beforeShowDay : function(){ console.log('test') }} );

Output:

// test
// test
// test
// test
// ba is undefined

if anyone has a clue what's the problem, please help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

奶气 2025-01-13 20:20:08

您必须添加此return [true,'']

像这样

$('#datePicker').datepicker({
    beforeShowDay: function(date) {
       console.log('test');
       return [true,''];
    }
});

参考。
http://osdir.com/ml/jquery-ui/2009-02 /msg00349.html

You have to add this return [true,'']

Like this

$('#datePicker').datepicker({
    beforeShowDay: function(date) {
       console.log('test');
       return [true,''];
    }
});

Ref.
http://osdir.com/ml/jquery-ui/2009-02/msg00349.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文