I might suggest you use the onload attribute of the iframe's element tag to trigger your function. To place an event handler on the iframe element, you'll have to wait until the main page has finished loading, in order to apply it. That might cause timing problems.
Here's an example of that approach, just replace the alert('') with your function name:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
</head>
<body>
<iframe id="ifOne" onload="alert('');" src="your_file_1.htm"></iframe>
<a href="#" onclick="document.getElementById('ifOne').src='your_file_2.htm';">file</a>
</body>
</html>
Bookmarks