Link to home
Start Free TrialLog in
Avatar of skiboy825
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.
ASKER CERTIFIED SOLUTION
Avatar of Batalf
Batalf
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KNVB HK
Which version of IE you are using?
I got NO problem at all.
it is possible as long as the framed page and the parent page belong to the same domain.