【问题标题】:Why alert is not working though event is fired?为什么尽管事件被触发,警报却不起作用?
【发布时间】:2016-05-21 11:13:51
【问题描述】:

当我尝试为将来的表行动态构建 jquery-ui datepicker 时。我发现了一些奇怪的东西。下面的代码就是问题所在。

$('#emp-table').live('focus','.obj-datepicker'function(){
        alert('this is not working though function work');
        $(this).datepicker({
            isActiveX: true
        }).next('a').click(function() { 
            $(this).prev().eq(0).datepicker("show"); 
        });
    })

我已经用谷歌搜索了这个奇怪的问题,但未能弄清楚。

为什么触发事件后警报不起作用???

【问题讨论】:

  • 使用来自 django 的错误跟踪更新问题。 500 可能意味着任何事情

标签: javascript jquery datepicker live


【解决方案1】:
$('#emp-table').live('focus','.obj-datepicker'function(){

这是您测试的确切代码吗?我觉得'.obj-datepicker'后面少了一个逗号,你可以删除重试。

【讨论】:

  • :) 没关系。您应该首先在 Chrome 或其他浏览器中检查控制台。然后你会发现错误。
猜你喜欢
  • 2011-09-19
  • 1970-01-01
  • 2020-10-28
  • 2021-02-09
  • 2012-09-16
  • 1970-01-01
  • 1970-01-01
  • 2014-06-26
  • 2016-07-05
相关资源
最近更新 更多