[thelist] Validation question

Kasimir K evolt at kasimir-k.fi
Sun Sep 4 13:05:39 CDT 2005


Peter-Paul Koch scribeva in 2005-09-04 17:05:
> I just tried to port http://www.quirksmode.org/css/displayimg.html to
> valid XHTML 1.0 . However, in doing so I encountered a very weird
> validation error.
...
> The validator gives an error stating that the first image, directly in
> the body, may not have an onload attribute. It's silent about the
> second image, though, the one in the div.
> 
> Can anyone explain this oddness? Either an [img /] element is allowed
> an onload attribute, or it isn't, I'd say.

The spec[0] says it isn't: "The onload event occurs when the user agent 
finishes loading a window or all frames within a FRAMESET. This 
attribute may be used with BODY and FRAMESET elements."

So I'd say that there's a bug in the validator.

.k


[0] 
http://www.w3.org/TR/1999/REC-html401-19991224/interact/scripts.html#h-18.2.3


More information about the thelist mailing list