[TYPO3-core] RFC: XHTML compliance of GMENU with onmouseoverimages(#874)
Martin Kutschker
Martin.Kutschker at blackbox.net
Sun Nov 13 10:21:55 CET 2005
Peter Niederlag <niederlag at ikd01.de> writes on
Sat, 12 Nov 2005 22:54:49 +0100 (MET):
> Hi,
>
> Martin Kutschker schrieb:
>
> > Sebastian Kurfuerst <sebastian at garbage-group.de> writes on
> > Sat, 12 Nov 2005 10:51:52 +0100 (MET):
> [...]
>
> > OTOH getELementById should never be called (for some years) with a
> > test if it's an available function.
>
> Sorry, could you clearify this for me?
>
> I use getElementById quite frequently (don't really know 'bout
> TYPO3's JS :-< ). Are U saying getElementById is a NoNo?
Not a No-no, but - as it might not be availale in older browses, you have to protect it's use. In the code you posted, ut'S tied to a ns3 version test. Netscape 3 had no getElementById.
So what I've asked for is to protect it eiterher with a typeof(document.getElementById == "funtion") or by some other means of capability testing (and setting globals vars like "n3", etc)
I think we still should try to reach the largest possible audience for our TYPO3-based websites. So IMHO eg a not-working roll-over in a an ancient browser is fine as long as it does not throw a Javscript error.
Masi
More information about the TYPO3-team-core
mailing list