当我尝试为表的 future 行动态构建 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");
});
})
我用谷歌搜索了这个奇怪的问题,但没能弄清楚。
Why alert is not working though event is fired???
最佳答案
$('#emp-table').live('focus','.obj-datepicker'function(){
这是您测试的确切代码吗?我认为'.obj-datepicker'
后面少了一个逗号,你可以删除并重试。
关于javascript - 尽管事件已触发,但为什么警报不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37362190/