javascript - How to execute Jquery for element returned from AJAX? -


i have function in js:

setrating(); 

and jquery ready body calling function:

$(function(){    setrating($('.ratings')); }); 

problem when html content ajax on page elements .ratings previous code not work.

seem need call setrating() in ajax response after getting content?!

you have call function after ajax done somethig this:

 request = $.ajax({                         ...                     });  request.done(function() {                           ...      setrating($('.ratings'));  }) 

because when function outside of request.done called before content created


Comments

Popular posts from this blog

java - BeanIO write annotated class to fixedlength -

Using Java 8 lambdas/transformations to combine and flatten two Maps -

How to connect android app to App engine -