My application has dynamically added Dropdowns.(我的应用程序动态添加了Dropdown。)
The user can add as many as they need to.(用户可以根据需要添加任意数量的内容。)
I was traditionally using jQuery's live()
method to detect when one of these Dropdowns was change()
ed:(我传统上使用jQuery的live()
方法来检测其中一个Dropdowns是否为change()
ed:)
$('select[name^="income_type_"]').live('change', function() {
alert($(this).val());
});
As of jQuery 1.7, I've updated this to:(从jQuery 1.7开始,我将其更新为:)
$('select[name^="income_type_"]').on('change', function() {
alert($(this).val());
});
Looking at the Docs, that should be perfectly valid (right?) - but the event handler never fires.(看看Docs,这应该是完全有效的(对吗?) - 但事件处理程序永远不会触发。)
Of course, I've confirmed jQuery 1.7 is loaded and running, etc. There are no errors in the error log.(当然,我已经确认jQuery 1.7已加载并正在运行等。错误日志中没有错误。)
What am I doing wrong?(我究竟做错了什么?)
Thanks!(谢谢!)
ask by Jack translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…