Sharing Functions between FramesOne common frame layout uses a permanent navigation frame and a content frame that might display a variety of different pages. Once again, it makes sense to put the call to the external JavaScript file into the page that's always present (the frameset page) instead of duplicating it for every possible content page. In Figure 5.10, we use this capability to have many pages share an identical function that returns a random banner image. Script 5.12 loads the pages into the frameset. Figure 5.10. The information in the right, or content, frame is created by code called from the frameset.[View full size image] Script 5.12. This script allows you to share functions between multiple frames.
To use a function on another page:
Tip
|
Friday, December 4, 2009
Sharing Functions between Frames
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment