how to implement a jQuery live bind event on mootools?

后端 未结 4 1217
别那么骄傲
别那么骄傲 2020-12-10 00:06

How do I make elements that are loaded via ajax, adopt the events associated with the same class on mootools 1.11?

As far as I know, in jQquery, if your ajax respons

4条回答
  •  忘掉有多难
    2020-12-10 00:35

    This is very cool idea, jQuery .live() works in similar way, but there is also problem with bubbling. If some parent has attached stopPropagation() for this event nothing happens.

    I think the ideal solution is building custom events, here is very good post about custom events written by Nicholas Zakas:

    http://www.nczonline.net/blog/2010/03/09/custom-events-in-javascript/

    But this example doesn't have event bubbling implemented yet. Some kind of bubbling which has fallback for it's prevention should solve the problem.

提交回复
热议问题