|
|
 |
RE: FN-FORUM: iframes, was: site check please
date posted 14th May 2007 10:58
Definitely side with Phil on this one - IFRAMEs were introduced back in
Internet Explorer 3 and support is fully mature in modern browsers. They =
are
very useful when a site design includes complex elements that you do not
want reloading on every page (for performance or continuity reasons).=20
For example, for a design featuring a multi-level JavaScript-driven =
dropdown
menu, content pages will display quicker if just the content changes =
within
an IFRAME, rather than reloading everything on every page. This is not =
just
a bandwidth issue - it takes time for the JavaScript to run, the browser =
to
recalculate the page layout etc each time. I also agree with Phil's
suggestion that reducing the amount of boilerplate HTML on each content =
page
is likely to have SEO benefits, by reducing the number of generic =
elements
on the page.
Addressing Alex's specific points (as there's a few old myths in there):
1. The problem you highlight only applies to IFRAMEs dynamically written =
to
the page using JavaScript (and even then, only Firefox), not standard =
HTML
IFRAMEs.
2. IFRAMEs print fine, either as part of the "outer page" or when =
printing
the IFRAME on its own (useful for excluding boilerplate elements from =
the
print out, e.g., menu).
3. "Save As" works just fine for IFRAME designs - I've just tried it in =
IE6
and content frames are saved without a problem.
4. If you wish to prevent a content page displaying outside the =
frameset,
simply add a simple bit of JavaScript to "onload" - something like:
if(location =3D=3D top.location)=20
top.location =3D "topPage.asp?content=3D" +
encodeURIComponent(location);
and have "topPage.asp" load the specified page into the IFRAME- job =
done!
5. IFRAMEs do *not* break the back/forward buttons in modern browsers =
and
haven't done so in a long while! Try visiting a IFRAME based site, then
check your history or hit your back button.
6. Conceded - a definite downside for any frame-based design is that the
top-level URL doesn't change when navigating pages. This can be =
confusing
for novice users trying to bookmark the page using the Favourites menu
(rather than right-clicking the page itself) - the workaround is to =
provide
an "Add to Favourites" button on each content page.
7. Do you have an example of a modern screen-reader than cannot handle
frames?
Hope that clears up a few old myths about FRAMEs/IFRAMEs - they do have =
a
useful purpose and most of the drawbacks that were reported at the time =
of
their introduction no longer apply. They help to improve responsiveness =
on
sites with complex boilerplate elements (e.g., drop down menus), but do
still have the drawback that the top-level URL doesn't change.
Note that a dynamically populated DIV (e.g., via AJAX) doesn't do the =
same
thing as an IFRAME - that really would break history/back features, =
would be
unbookmarkable and couldn't be indexed by search engines, so generally =
not a
good idea! A DIV with "overflow:auto" wouldn't prevent boilerplate =
elements
needing to be reloaded on each page.
Best regards,=20
Ben
--
Ben Johnson, Neogic Web Solutions
// design . development . managed hosting
w | http://www.neogic.com
t | +44 (0)1242 808 262
e | [EMAIL REMOVED]
|
 |
|