[thelist] Site redirect check : old browser

.jeff jeff at members.evolt.org
Fri Jun 8 22:47:58 CDT 2001


: From: Mark Cheng
: How is a standard compliant site supposed to
: work in a browser which does not support
: standards? eg DOM?

it should display the site in roughly the same manner as a standards
compliant browser would render the site if you detached the stylesheet from
it -- likely linearly.

: If I use getElementById, which is in the DOM
: standard, should I insert non standard code
: so the site works? eg document.all,
: document.layers?

no, you can continue to use getElementById, but make sure that the browser
renders the page without javascript.  if so, then you'll have an idea of how
browsers that don't support getElementById will behave.  take this rework of
one of your pages as an example:


no javascript errors for non-compliant browsers.  the site is still
browseable by dom compliant browsers with javascript disabled.  it's still
viewable by browsers that don't support getElementById.  it's still usable
by older non-standards compliant browsers.

what's so difficult about doing it like i've put together?  the conversion
you see has no less functionality and it took me all of 10 minutes to do.
tested on win2k with nn2.0, nn3.04, nn4.08, nn6 (m18), opera 4.02, opera
5.02, and webtv 2.5 (which is *really* messed up for some reason).  also
tested on the mac with ie5 (which is kinda messed up), nn2.02, nn3.04, and
nn4.7.  with the exception of webtv 2.5 on win2k and ie5 on mac (which is
standards compliant) it displayed without errors (albiet different layouts).
there were javascript errors in ie5 on the mac.

the only thing you'd have to do different is make sure the right submenu was
first in the html for non-js enabled browsers so they see the right submenu.

: If the site uses CSSP only, then I agree - it will
: degrade and using positioning it will degrade nicely.
: However, I think that misses the point - standard
: compliance means compliance with all standards, not
: just the ones people can see.

yes, but it's also up to you as the programmer to make sure that you're
doing adequate checks that objects and methods are supported before using
them.  just because they're part of a standard doesn't mean you can just use
them with reckless abandon.  it's your responsibility to make sure they
don't cause errors in the users browser.

good luck,


jeff at members.evolt.org

More information about the thelist mailing list