Electric Type

Multimedia

About Us

News

Help

The IFrames Lowdown

Page 5 — I Think I'll Name it Fred

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:

    <iframe width=150 height=200 src="blahblah.html">

    <frame src="blahblah.html">

    </iframe>

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.


Dynamic HTML  

Frames  

HTML Basics  

Stylesheets  

Tables  

XML  

Javascript  

Database Connections  

Intro To Perl  

HTML 4.0  

User Blogs

Screen Shots

Latest Updates

Contact Us

Valid HTML 4.01!
Valid CSS!

Breadcrumb

© ElectricType
Maintained by My-Hosts.com
Site map | Copyright | Disclaimer
Privacy policy | Acceptable Use Policy
Legal information.