I've got a javascript function in one frame that I would like to access from another frame. Is this possible?
| SitePoint Sponsor |
I've got a javascript function in one frame that I would like to access from another frame. Is this possible?


Hey,
It's very possible. To access a frame, you go:
parent.frameName
and change frameName to the name of the frame you want to access. So, to access a function in anothe frame, just use:
parent.frameName.window.functionName()
and change functionName() to the name of your function.
Hope that helps,
aDog![]()
Moderator at www.javascriptcity.com/forums/
Thanks for the info aDog, but how do I actually use a link to call the function?


Hey,
You'd just go:
aDogCode:<a href="javascript:parent.frameName.window.functionName()">Other Frame Function</a>
<Edited by kyank on 01-23-2001 at 07:07 PM>
Moderator at www.javascriptcity.com/forums/
Bookmarks