开发者

Jquery on element loaded via Ajax

开发者 https://www.devze.com 2023-02-19 21:53 出处:网络
Jquery makes it easy to register callbacks on events happening in a doc. However, in one of the apps we\'re building, we need t开发者_如何学运维o register callbacks on existing elements in the page, b

Jquery makes it easy to register callbacks on events happening in a doc. However, in one of the apps we're building, we need t开发者_如何学运维o register callbacks on existing elements in the page, but also on elements that are loaded later via Ajax upon user actions.


Take a look at jQuery 'live' http://api.jquery.com/live/

Let's you do exactly what you are trying.

Bob


You can re-register the events after success or use .live()

0

精彩评论

暂无评论...
验证码 换一张
取 消