2
如何将事件添加到由AJAX加载的元素。将事件添加到动态生成的元素
jQuery有live
,但Mootools的等价物是什么?
例如:等效
window.addEvent('domready', function() {
// some code which loads new elements by ajax
// Filter
$$('.filterButton').addEvent('click', function(event) {
alert('wow');
});
});
可能重复的[如何在mootools上实现jQuery活动绑定事件?](http://stackoverflow.com/questions/2107892/how-to-implement-a-jquery-live-bind-event-on- mootools的)。在发布问题之前您是否在寻找?将“mootools jquery live live”这个单词放到google的搜索框中,马上给出答案。毫不奇怪,它在StackOverflow上:-)我的意思是大约需要10秒钟的时间,如果你有打开和搜索谷歌的捷径,可能会更少。 –
这个答案已经过时了,所以他也问过。 –