views:

32

answers:

2

I am using frameset in my page. In the frameset i have taken two frames and in the first frame i have written some javascript code. How the javascript function of the frame will call the javascript function of the main page.

Can anyone please help :)

+1  A: 

This will do it :

parent.FrameName.FunctionName()
jknair
A: 

If your frames are set up like this:

<frameset rows="50, 50">
    <frame src="menu.html" name="menu">
    <frame src="main.html" name="main">
</frameset>

Then you can access functions in the frame named main from the frame named menu using top.main.functionName().

parent.main.functionName() will also work in this case, but if you have more nested levels of frames then I find it less confusing to reference top (which is always the topmost frame) and 'drill down'.

Mark B