skiboy825
asked on
access javascript function from parent from child iframe?
Is it possible to access a javascript function from an iframe? For example:
Parent.htm
<script language='Javascript'>
function blah() {
alert("here");
}
</script>
<iframe id='testing' src='content.htm'>
~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~
content.htm
<script language='Javascript'>
parent.blah();
</script>
Note that this does not work.
Parent.htm
<script language='Javascript'>
function blah() {
alert("here");
}
</script>
<iframe id='testing' src='content.htm'>
~~~~~~~~~~~~~~~~~~~~~~~~~~
content.htm
<script language='Javascript'>
parent.blah();
</script>
Note that this does not work.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
it is possible as long as the framed page and the parent page belong to the same domain.
I got NO problem at all.