PDA

View Full Version : Calling javascript function from iframe in IE


elmu
01-29-2008, 06:36 AM
Hello,

I have a page with an iframe. The page defines some JavaScript functions in the head part. How can I access these functions from the iframe? In Firefox I can use parent.myFunction() but it doesn't work in IE.

Any idea?

Thanks in advance!

sandstorm
01-29-2008, 09:43 AM
Hello,

I had this very problem and resorted in putting the javascript in the inner iframe and accessing the functions using window.frames.iframeName.functionName().

Jon Hanlon
01-29-2008, 06:04 PM
Try
parent.frames['iFrameName'].window.myFunction()
or
parent.frames.iFrameName.window.myFunction()