Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在一个 knockoutJS foreach 中有一个 jQuery 点击绑定,但它不工作。我相信淘汰赛正在阻止传播。
有没有办法让它工作?我试图避免通过淘汰赛绑定到点击事件。
在没有看到任何代码的情况下,我只能假设您正在做类似的事情
$('element').on('click', function(e){});
要将点击事件绑定到动态生成的对象,您需要有这样的点击事件
$('body').on('click', 'element', function(e){});