Setting a TargetIf your site uses frames, it's common to have a framed navigation bar that loads the different pages into the main frame. The main frame is the target for the links in the navigation bar, and to load that main frame using HTML, you use the target attribute of the <a> tag. But if you want to use both frames and XHTML Strict, JavaScript is the only way to set the target. That's because the target attribute isn't allowed in XHTML Strict, and you have to set the target in order to use frames. The XHTML Strict frameset in Script 5.7 allows you to load your choice of page into the main content frame, just by clicking a link in the left frame (Script 5.8, detailed below). The result is shown in Figure 5.8. Script 5.7. When you're using HTML Strict in your frameset, you need JavaScript to set frame targets.
Script 5.8. And here is the JavaScript you need to do the job.
Figure 5.8. Here's a frame acting as a navigation bar with the content page appearing in a content frame.To set the target for a frame:
Tip
|