Forum Moderators: open
<html>
...
<iframe id="sub_frame" src="sub_frame.html"></iframe>
...
<script type="text/javascript"><!--
test_function();
//-->
</script>
</html>
And this is sub_frame.html
<html>
...
<head>
<script type="text/javascript"><!--
function sub_function()
{
alert('hello inside iframe');
}
//-->
</script>
</head>
</html>
And how to write test_function() to call sub_function from parent window?
I tried
function test_function()
{
document.getElementById('sub_frame').sub_function();
}