[thelist] onClick troubles

Jeff Howden jeff at jeffhowden.com
Mon Sep 8 02:06:59 CDT 2003


tim,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Tim Burgan
>
> I'm having trouble with onClick events on a page I'm
> developing [1].  The events work fine in IE6 & Opera
> 7, but they don't work in Mozilla 1.4, so I'm assuming
> they won't work in Netscape either.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

start by running that page through the validator.  there are a number of
errors in the html.

second, ditch the use of inline scripting like you've done.  instead, write
a function that takes 2 arguments, an id and a string of text.  in that
function, be sure to test for support for the getElementById() method and
the innerText property.  if it exists, *then* do your fancy stuff.  this
will prevent nasty errors from happening for any ua with scripting enabled
that doesn't support the getElementById() method or innerText property.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> I would like this page to be as compatible with
> Netscape 4 as possible .. although much of the CSS
> probably won't work at the moment.
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

nn4 compatibility with regard to dhtml is a nightmare.  i'd suggest you
don't even go there unless you wish to make your life extremely miserable.
instead, start out by making the site work with any scripting.  that will
get you the nn4 compatibility (along with all sorts of other ua's that
either don't support scripting at all, don't support scripting to the level
you need, or have scripting disabled).  then, go back in and add the
scripting to improve the experience (hopefully) for everyone that supports
it.

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> [1] <http://www.greaterthani.com/02_relaunch/>
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

on another note, the following...

	<!--
	__________________________________________________________________

	Copyright © 2003 Tim Burgan. All Rights Reserved.
	Developed by Tim Burgan.
	This site is licenced to 'GreaterThanI.com'.
	__________________________________________________________________

	-->

... will put ie6 into quirks mode.  you may not want that to happen.  i'd
advise you either move it after the <!doctype> or remove it entirely.

oh, and licenced (sic) is misspelled.

.jeff

——————————————————————————————————————————————————————
Jeff Howden - Web Application Specialist
Résumé - http://jeffhowden.com/about/resume/
Code Library - http://evolt.jeffhowden.com/jeff/code/




More information about the thelist mailing list