【问题标题】:datepicker changedate not defined日期选择器更改日期未定义
【发布时间】:2015-06-01 14:00:49
【问题描述】:

我正在尝试使用引导日期选择器,我需要事件 changeDate。所以我拿了文档

$('.datepicker').datepicker()
    .on(picker_event, function(e){
        # `e` here contains the extra attributes
    });

我用 changeDate 事件来调整它

$('.datepicker').datepicker()
    .on(changeDate, function(e){
        alert('yolotest');
    });

可悲的是,他将 changeDate 视为未知变量(导致错误 changeDate is not defined)而不是事件。

我现在真的被困住了,我想知道您是否对如何使这项工作有所了解。我不明白他为什么认为changeDate 是一个变量而不是一个事件(我试过changedateChangedateChangeDate,同样的错误)

【问题讨论】:

    标签: bootstrap-datepicker


    【解决方案1】:

    你需要在 changeDate 附近有' '

    $('.datepicker').datepicker()
        .on('changeDate', function(e){
            alert('yolotest');
        });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-08-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-06-25
      相关资源
      最近更新 更多