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.
我正在为 twitter 开发 chrome 扩展程序,我遇到的唯一问题是,当您在 twitter 上向下滚动时,它会添加到页面中,对吗?好吧,当这种情况发生时,我需要更新我的 jquery 函数,否则点击函数将无法在新加载的推文上工作。
您可能需要优先使用 jQuery 函数live()或on()。
像这样的东西:
$(document).on('click', '.yourClass', function() { //doSomething });
这将确保新生成的内容也会受到影响。