W3C home > Mailing lists > Public > www-validator@w3.org > April 2013

Re: Error message - there is no attribute "onload"

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Sat, 27 Apr 2013 23:35:47 +0300
Message-ID: <517C36A3.6040608@cs.tut.fi>
To: barry.pidcock@ntlworld.com
CC: www-validator@w3.org
2013-04-25 11:54, Susan Pidcock wrote:

> I get the following Error message when validating by document
>
>  1. Error /Line 239, Column 235/: there is no attribute "onload"

That's because it appears in an <img> element and the document declares 
XHTML 1.0 Transitional, in which the onload attribute is allowed in the 
<body> element only.

Attributes like onload are generally old-fashioned, and many people 
favor doing JavaScript things in external JavaScript files, instead of 
throwing in pieces of JavaScript code into HTML attributes. But changing 
an existing site to do so would be a major effort. In this case, just 
ignore the error message, if you are confident enough that the attribute 
is supported by relevant browsers for <img> elements.

> Please find attached a zipped version of the  document concerned.

In future, please post a URL in a problem report, instead of sending a 
page as an attachment.

Yucca
Received on Saturday, 27 April 2013 20:36:17 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:18:08 UTC