Loading two frames with one link
How to access objects in one frame from another
Ok, the title may be a little ambiguous, but lets do an example to see what I mean by "cross-accessing" objects. Lets say we have a basic two-columned frame:
Further more, lets assume this is what's in page1.htm:
Ok, so we've created a little script in page1, that when run, will alert something. Normally, you can only call this function in page1, by doing something like this:
That's all there is to it. Notice we have to first give each frame a name before proceeding (as mentioned in the previous section when adding specific types of links). For example, lets create the above master page, and add in some names so we can access page1's function from page2!
<html> <frameset cols="30%,70%"> <frame src="page1.htm" name="foody"> <frame src="page2.htm" name="goody"> </frameset> </html>
Now, to access page1's lame little function, this is what we will do in page2:
//page2.htm <html> <body> <script> parent.foody.testing() </script> </body> </html>
Knowing this syntax, we can access any objects/properties/variables stored in one frame from another. The example above will cause the function to be run in page1, although we called it in page2.