[thelist] Wanted: the definitive fool-proof mouseover JavaScript

.jeff jeff at members.evolt.org
Thu Jun 28 01:18:16 CDT 2001


paola,

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: From: Paola Kathuria
:
: That's no reason for me to ignore some
: users when I know there's a solution
: that fails gracefully for them.
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

maybe.  just don't go shooting the majority for the sake of so very few.

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: Nope, IE3 and NS2.02 ignore the JS1.1
: script whilst NN3 runs it (Win).
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

specifically which versions of ie3?  some versions of ie3 support the image
object if you can believe that.  some support external javascript files.
some do not.  if you're going to be implementing a solution like this for
ie3, then you need to run the tests on as many versions (platform and minor
versions) as you can find.  i know i couldn't confidently say that using the
language attribute wouldn't bomb in some versions of ie3.

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: Well, the setting/testing of a version
: variable is one of the suggested
: compatibility approaches in O'Reilly's
: book _JavaScript: A Definitive Guide_
: (3rd Ed).
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

i find using the language attribute of the script tag to be flaky at best
and would have a hard time being convinced it could ever be relied on.

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: > you're sending extra kb down the pipe for
: > *every* browser so you can catch the problem
: > for likely less than 0.1% of your browser
: > users.
:
: I don't know what extra KB you're referring to.
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

the 0.12kb for the first <script> block.

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: The combined code of my proposed mouseover
: scripts for 3 buttons are about 760 bytes.
: When I use yours for the same buttons, it's
: over a kilobyte (or 750 bytes without the
: indentation).
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

are you using the preload bits in your calculation?  if so, have you taken
into consideration the difference in size between your version and my
version?

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: Since you've said that it's not illegal to
: define the same function twice in consecutive
: scripts, I won't need to do explicit JS version
: testing.
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

by using the different language attribute values you *are* doing explicit js
version testing.

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: And since this new script stops IE3
: error messages with only an extra 30 bytes
: (compared to testing for document.images), I
: think it's a better alternative.
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

i've still gotta wonder though -- for as long as we've had the hassle of
developing for ie3, don't you think this sort of solution would have been
discovered already?  that to me is an indication that's there's probably
something crucial missing (lots of minor version number browsers) from your
testing.

:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
: I've now tested the script on:
: - IE 3.0, 4.0, 5.5 (Win)
: - NS 2.02, 3.04, 4.7, 4.72 (Win); 4.77 (Linux); 4.0.5 (Mac)
: - Mozilla 0.9+ (Linux)
: - Opera 5.11 (Win)
:~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

add nn2.02/mac, nn3.04/mac, ie5/mac, opera4/win, and webtv2/win to the mix
of browsers that support it.  frankly i'm not really surprised by the
post-js1.0 browsers supporting it.  it's the js1.0 browsers, specifically
all the various, bug-ridden versions of ie3, that haven't been tested yet.

good luck,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/






More information about the thelist mailing list