process body onload event for multiple iframes on html page

process body onload event for multiple iframes on html page

I have an html page with several iframes on it. The iframes all load a particular javascript file called main.js. In that javascript file, there is a function X. How can I through code written in the main.js file cause function X to be called upon the body onload event of each iframe?

Some of the body elements in the iframes already have a onload function specified in the <body> tag in their html file. I would like this function X to be called in addition to any such specified functions in the file.

I have tried a couple of approaches such as:
$('body')._load(function() { functionX(); });
$('body').load(function() { functionX(); });
$('body').bind("load", function() { functionX(); });
I've tried the above beginning with $("iframe")... too.

None of them have worked. FunctionX is never called. I want function X invoked for each iframe's body without having to manually add the call to the html file for every iframe. There a large number of html iframe files.