So I’m currently using .append() to add a feature to all of the posts on a webpage, but when additional posts are loaded on the page, the appended features aren’t included in the new content — I’m trying to come up with a way to make sure all of the new content has the appended feature too.
$(this).append('<div id="new_feature></div>');
Something like this?
$(this).live().append('<div id="new_feature></div>');
Maybe there’s a way to make it constantly appending in a loop perhaps?
jQuerydocumentation:You can use
setTimeout()function that can check for new<div>s every n milliseconds.So say
thisis a div withclass="comment newdiv", so when it appears on the page for the first time, it has the classnewdivthat will let the function know it was just dynamically created.