【问题标题】:jquery ui datepicker error on beforeShowDaybeforeShowDay上的jquery ui datepicker错误
【发布时间】:2012-03-10 14:20:29
【问题描述】:

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

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

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

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

输出:

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

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

【问题讨论】:

    标签: javascript jquery jquery-ui jquery-ui-datepicker


    【解决方案1】:

    你必须添加这个return [true,'']

    像这样

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

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

    【讨论】:

    • 是的,我刚刚找到了完全相同的来源。谢谢
    猜你喜欢
    • 1970-01-01
    • 2017-12-12
    • 1970-01-01
    • 2013-02-27
    • 2013-01-07
    • 2017-02-21
    • 1970-01-01
    • 2012-04-27
    • 1970-01-01
    相关资源
    最近更新 更多