Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Calling a function in parent file from child frame?

I have a function that resizes the col width ratio of my frameset in "frame.html":

<frameset id="set" cols="*,*" FRAMESPACING=0 BORDER=3 BORDERCOLOR=#eeeeee>
    <frame src="index.html">
    <frame src="index2.html"> 
    <noframes></noframes> 
</frameset> 

The function works fine when called from "frame.html", However i want to call said function from the child file "index.html"... the function needs to remain in the parent file in order to run properly... How can I call my function in frame.html from index.html

like image 640
David Avatar asked Dec 22 '22 23:12

David


1 Answers

Just try parent.functionName() it should work.

Edit


Just to be sure that the scope is correct you should probably call window.parent.functionName() instead to be sure that it is actually the frames parent that is referenced

Edit 2


Check out this answer it seems to handle the same chrome issue.

Hope it helps!

like image 104
Karl Johan Avatar answered Jan 07 '23 15:01

Karl Johan