且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jQuery的我怎么用Ajax加载的内容互动?

更新时间:2023-12-05 08:17:22

.live()的回答你的问题:

http://api.jquery.com/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.