I think you need to add load events for frames. Add a load event to the document.ready function, as shown below. If it works, you can omit the window load event that you already have for filtering frame data.
$(document).ready(function(){ $('.test').load(function () { var filteredContents1 = $('#frame1').contents().find('#divChild').html(); $('#frame1').contents().find('body').html(filteredContents1); }); });
Poll request update
$(document).ready(function(){ $('.test').load(function () { $('#frame1, #frame2, #frame3').each(function(){ var filteredContents1 = $(this).contents().find('#divChild').html(); $(this).contents().find('body').html(filteredContents1); }); }); });
.
Adil source share