Writing for the World Wide Web | |
Home Course Information Assignments Schedule Class Notes Resources Student Pages |
Class Notes
Planning Site Navigation Organizing WWW Files Using Webpage Editors Upload / Download (FTP) Visual Design Appropriate Use of Technology Unix Commands Cascading Style Sheets JavaScript |
Changing Two Frames with One Link
Note: This JavaScript requires an understanding of using HTML Frames. When using frames, you may sometimes designate one frame to hold a menu and one frame to hold the information for your page. In some instances, you may want to be able to change the content of both windows with a single link, possibly to load a new menu when new information appears in the info frame. Just create your pages similar to the following example; start with something like this for your frames page:
Which would create a page that looks something like this:
You want to be sure to not only have initial pages load into your frames page (the src attribute), but you also want to name all of your frames so you can refer to them with JavaScript functions. Include a link in your menu1.html file with this onclick function:
The above lines of code placed in the head of your document will generate the alert window you saw when this page loaded. Here is a basic breakdown of what each part means:
Clicking the link would change the page to look something like this:
The code should provide you with a feature like this example. |