3 回答
TA貢獻1895條經驗 獲得超7個贊
livedelegate
livebind:
$('a.myClass').live('click', function() { ... });delegate
$('#containerElement').delegate('a.myClass', 'click', function() { ... });livedocumentdelegate#containerElementlive
livea.myClassdelegate#containerElement
livea.myClass 它現在是否存在. delegate
delegatelivelivedelegate
livedelegateon
$('#containerElement').on('click', 'a.myClass', function() { ... });TA貢獻1830條經驗 獲得超3個贊
你會用 delegate在 body元素,所以您只需使用 live而是因為它更簡單。 您需要使用jQuery庫的舊版本,其中 delegate事件尚未實現。
添加回答
舉報
