javascript - Jquery function is not working on AJAX loaded elements -


don't throw rocks @ me. asked similar not long ago different. know have delegate event make them work on newly loaded element. if there no event delegate, function need use new elements?

let's suppose one:

function fixheight (x) {         $(".test").height(x); };   

now every time load content has elements class ".test", functions runs, won't affects new elements.

$.get( url, function(data){     //some code inserts data retrieved in existing element     fixheight (x);  }).fail(function() {     //fallback code }); 

any ideas? thanks!

call function after append element dom


Comments

Popular posts from this blog

android - ConstraintLayout: Realign baseline constraint in case if dependent view visibility was set to GONE -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -