• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 6. Frames, Frames, and More Frames > Sharing Functions Between Frames

Sharing Functions Between Frames

One common frame layout uses a permanent navigation frame and a content frame that might display a variety of different pages. If all those content pages need to call an identical JavaScript, it makes sense to put the function into the page that's always present instead of duplicating it for every possible content page. In Figure 6.10, we use this capability to have many pages share an identical function that returns a random banner image. This requires that part of the code be in the navigation frame and part in the content frame. Script 6.17 loads the pages into the frameset.

Figure 6.10. The information in the right, or content, frame is created by code shared by both the navigation bar frame, and the content frame itself.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint