I have a page loading an iFrame that has a source based on which link the user clicks on. The IFrame returns a small table in which I need to add a row.
My problem is that I need to use something like .live or .delegate, since the iFrame does not load on document.ready. How to associate .append with .live or .delegate on an iFrame load, rather than a click or mouse function?
I tried:
$(document).ready(function(){
$('#click').click(function(){
$('#myFrame').attr('src', 'http://iframe_link_here/');
});
$('<tr><td>New Row</td><td>goes here</td></tr>').appendTo('#myTable');
});
but since the table is not in the .ready document, and since I want to add this line to the iFrame load and just don’t know how to attach it.
Thanks for any help.
source
share