Targeting within the <iframe> tag works exactly like it
would in a typical <frame> tag (see Jill's column on naming and targeting for a fuller
explanation). In order to send a new page to the floating frame window, you
have to give your frame a name:
<iframe width=150 height=200 src="blah.html" align=left
frameborder=10 hspace=10 vspace=10 name="fred">
</iframe>
Now that your frame has a name, you can address (or target) it whenever
you want to send it new content. So you can place a link on your page that
looks like this:
<a href="yackitysmackity.html"
target="fred">Gimme!</a>
When you follow that link, it will send the contents of
yackitysmackity.html to your floating iframe named fred.
So now you've got a really cool floating iframe that you can see with IE3
or higher, Netscape 6, or various other recently released browsers. But what
do people with older browsers see? Not much.
Older versions of Netscape Navigator don't recognize the
<iframe> tag. In fact, release 4.7 completely ignores it.
So how can you get the most out of your documents while still maintaining
backwards compatibility?
Well, the other iframe tutorials I've seen suggest you include a
<frame> tag between <iframe> and
</iframe> tags. Like this:
But I'm more than a little bit skeptical about this solution since I've yet to see it
work on every single browser out there. Some would say that you're better
off taking a chance and presenting your content in iframes anyway. After
all, people need the incentive to upgrade their browsers, right? Of course,
the smart thing to do would be to set up a server-side browser detection script that serves pages with iframes to the newer browsers and boring vanilla
pages to the older browsers.
The choice, as always, is yours.