W3C home > Mailing lists > Public > www-validator@w3.org > March 2008

Re: [VE][108] onload attribute does not exist for < IMG>?

From: David Dorward <david@dorward.me.uk>
Date: Wed, 26 Mar 2008 10:09:18 +0000
Message-Id: <936FF861-5547-4B08-9928-DBA6120D0142@dorward.me.uk>
Cc: www-validator@w3.org
To: Ruben Tilis <tilis@netvision.net.il>

On 25 Mar 2008, at 16:16, Ruben Tilis wrote:
> W3 describes "onload" event: " The onload event occurs immediately  
> after a page or an image is loaded.".  Please see at your  
> page:http://www.w3schools.com/jsref/jsref_onload.asp
Despite their misleading name, the highly error prone W3Schools is  
not, in any way, associated with the W3C.

If you check the specification ( http://www.w3.org/TR/html4/index/ 
attributes.html ), you will see the onload attribute is only  
supported by the body and frameset elements in HTML 4.x and XHTML 1.x.

> This event attribute is essential for dealing with every loading  
> element.

No, it isn't, since JavaScript can be used to attach events.

A lot of current thinking considers intrinsic event attributes to be  
something to be avoided in favour of scripts which can be added to  
the document and which then operate on elements based on their  
classes and ids.


> All browsers support this attribute

No, they don't.

> and I just can't see why W3 contradicts it's itself

It doesn't.

> and force developers to choose between bad programming and  
> forsaking W3 validation.

As explained above, it doesn't.

David Dorward
Received on Wednesday, 26 March 2008 10:10:13 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:59:06 UTC