Click to See Complete Forum and Search --> : Calling the Gurus - FRAMES question


vincentms
04-21-2003, 10:09 AM
Hello everybody,

I am stumped!!!

Is it possible for me to do what I am trying to do in the sample code below. As you see I have defined to frames.

I want to know is it possible for me to click the START button in the Main1 frame and have it execute the getNext() function which is in the Main2 frame? It is in a different URL.

If it is possible, which I doubt, please show me an example.

See the sample code below.

Thanks,
Vincent

Zürich Switzerland





This is: Main

<HTML>
<HEAD>
</HEAD>

<frameset NAME="****" rows="20%,80%" BORDER=0 framespacing=0 frameborder=0 SCROLLING=NO NORESIZE>
<frame src="C:\ExamCabinet2\main1.html" SCROLLING=NO NORESIZE>
<frame src="C:\ExamCabinet2\main2.html" SCROLLING=NO NORESIZE>
</frameset>


</BODY>
</HTML>


This is: Main1

<HTML>
<HEAD>
</HEAD>
<BODY bgcolor="#ffffff" text="#000000" link="#0000ff">
<FONT color="navy">
<H1>
<img src="c:/ExamCabinet2/sap_logo.gif" height=23>
Practice Exam &nbsp
<img src="c:/ExamCabinet2/crystal-logo.gif" height=30 >
<img src="c:/ExamCabinet2/cognos-logo.gif" height=20 >
<input type="button" value="START" onClick="getNext()">
</H1>
<TR>
<TD>
<HR style='height:8px' color='#00b0eb'></HR><br>
</TD>
</TR>
</FONT>
</BODY>
</HTML>


This is: Main2

<HTML>
<HEAD>
<SCRIPT>

getNext();
var p;

displayNext();
var q;

</SCRIPT>

</HEAD>
<BODY>

</BODY>
</HTML>

AdamGundry
04-21-2003, 10:48 AM
If you name each individual frame, I think you can refer to functions cross-frame with:
top.framename.function();

This won't work if the frames come from different domains, due to browser security restrictions.

Adam

vincentms
04-21-2003, 05:33 PM
Thanks Adam!!!