javascript - Detect ul list content change jQuery -
we have unordered list id #some-list. in our backbone implementation, when data returned, list entries rendered , appended list , list displayed.
we want detect when such change completed using jquery. used $(#some-list).ready()
, $(#some-list).load()
, looks not working.
what ways capture such change? shed lights here?
well didn't post code it's hard see guess fail.
in general trigger custom event on ajax callback (you use ajax content , appending list right?).
for example:
loaddata(){ // invoke ajax request var def = $.get(...); def.then(function(result){ // $(#ul) append(result) ... // trigger custom event $(document).trigger('listrendred'); }); }
now on different place or script can listen it:
$(document).on('listrendred', function(e){ // ever... })
Comments
Post a Comment