Trying to refresh a Google advertisement located within divs that all share a common CSS class called 'adslot'. Some of these divs are loaded via ajax. However, upon document ready, using the jQuery each function only applies to the divs that were loaded before the ajax call. For instance, if we check the number of available '.adslot', it will be
alert($('.adslot').length);
The output is 5, which is accurate. Three of these divs were generated before the ajax call, and two were generated after.
If I try-
$('.adslot').each(function() {
var id = $(this).attr('id');
alert(id);
});
I only receive alerts for the IDs of the first three divs that were generated before the ajax call.
Is there a method to read the IDs of all five divs with jQuery?