Re: Javascript wiz please.

by =?iso-8859-1?Q?St=E9phane?= Bergeron <berlar(at)generation.net>

 Date:  Tue, 08 Jun 1999 19:46:09 -0400
 To:  "Don" <dledarney(at)man.net>
 Cc:  hwg-graphics(at)hwg.org
 In-Reply-To:  don
  todo: View Thread, Original
At 02:03 PM 08/06/99 -0700, you wrote:
>Hi
>
>I've re-desinged my splash page and trying to validate HTML 4 @ W3C.
>
>I continually get the following ONE error on the image I've sliced and
>placed a rollover and link to from
>http://validator.w3.org/
>
>
>Error at line 153:
>                name=3D"f1" src=3D"f1.jpg" width=3D"206" height=3D"95"=
 border=3D"0"
>                     there is no attribute "NAME" (explanation...)

Hi Don,

Your problem is very simple.  According to the specs the image element does=
=20
not have a NAME attribute, never did, never will.  This is a hack invented=
=20
by Netscape.  You should use the ID attribute instead which has been around=
=20
since the HTML 3.2 spec came out but of course your rollovers will not work=
=20
in Netscape because they didn't see fit to support the standard way.  You=20
can also use the image array instead to achieve the same effect without=20
needing to specifically name your images.  It will work in Netscape but you=
=20
should then be aware of an aggravating bug Netscape 3.x (on the PC) has=20
with that method (it displays the "on" images from the top left of the=20
browser window, no matter where the original image is on the page).  If you=
=20
want to get more info on all this, do a search in the Techniques list=20
archives, this topic has been discussed countless times there and you will=
=20
surely find some sample code.

HTH!

St=E9phane Bergeron

HWG: hwg-graphics mailing list archives, maintained by Webmasters @ IWA