更新时间:2023-12-05 08:17:22
.live()
的回答你的问题:
从文档:
的.live()方法能够影响尚未被元件 处理程序绑定:通过使用事件代表团加入到DOM 祖代元素负责所触发的事件 它的后代。传递给.live处理程序()永远不会绑定到一个 元件;相反,.live()绑定一个特殊的处理程序的根 DOM树。
The .live() method is able to affect elements that have not yet been added to the DOM through the use of event delegation: a handler bound to an ancestor element is responsible for events that are triggered on its descendants. The handler passed to .live() is never bound to an element; instead, .live() binds a special handler to the root of the DOM tree.