Search code examples
ajaxmootoolsmootools-events

How to bind events in mootools after ajax response


Any idea how to bind mouseover events in mootools after an ajax response.

Tried as follows

onSuccess : function(responseTree, responseElements, responseHTML, responseJavaScript) {

              Elements.from(responseHTML).inject($('load-content'));

            $('load-content').fireEvent('mouseover');

            }

but it won't works


Solution

  • try the following:

    $('load-content').addEvent('mouseover', function(e){
        // your code
    });