I have an table where every row has a hidden iframe on it. When the iframe is done loading it should call a function that sits on the parent page (this works). However, when the parent function is called I need to pass the row value… but since it is the iframe making the call I don’t know how to get the row.
function myRowCallback(rowIndex){
alert('row ' + rowIndex + ' is done loading');
}
<table>
<tr>
<td><iframe id='frame1' onload='myRowCallback($(this).closest('tr').prevAll().length)' style='display: none;'></td>
<td><iframe id='frame2' onload='myRowCallback($(this).closest('tr').prevAll().length)' style='display: none;'></td>
<td><iframe id='frame3' onload='myRowCallback($(this).closest('tr').prevAll().length)' style='display: none;'></td>
</tr>
</table>
You need to do this as
use
parent.to call parent function