Re: use of name and id in XHTML frame element

You have to be careful with name and id. Name is indeed depricated, but that
doesn't mean it's not valid in XHTML documents. It is left in the spec to
support older, broken browsers that don't fully support HTML 4.01 (this
means Netscape 4.x and below, which don't recognize "id" as a valid target).

Because of that, it is a good idea to use both id and name, but you have to
be careful when doing so, since just about any tag in XHTML can take the id
attribute, but only some of them can take the name attribute. This may
necessitate the use of an empty anchor (<a name="fubar" id="fubar"></a>) if
you need to tag something that doesn't support the name attribute.

Not sure how all this interacts with the name attributes on framesets, but
you do want to make sure that you test the code against the validator, and
test its operation in both modern browsers and older ones (Netscape 4.x
specifically), to make sure it actually works. I had a hyperlink on one of
my sites for about two weeks that worked fine in IE on the desktop, but I
couldn't figure out why it wasn't working in Pocket IE on my Pocket  PC,
until I discovered that it didn't work in Netscape 4.x either, and I
remembered that Pocket IE is a 4.x class browser, which doesn't support HTML
4.01...

----- Original Message -----
From: "Jim Isaak" <j.isaak@computer.org>
To: <www-validator@w3.org>
Sent: Thursday, November 29, 2001 7:18 AM
Subject: use of name and id in XHTML frame element


> I'm using validator as part of my web design
> classes, and the example below as a question
> on "well-formed" vs "valid" vs "legal" for
> XHTML frameset DTD.  (when enclosed in
> <?xml, <!DOCTYPE, <html xmlns... tags.)
> It is well formed and illegal (copyright issue)
> but is it valid? ... following the lead in Dave
> Ragget's book (WROX, Beginning XHTML, pg197)
> the "name" attribute is deprecated, and "id"
> attribute the correct way to indicate the
> frame name.  However, it validates as "OK"
> with validator (using "name" but not "id").
>
> Should ID be required if name is included?
> (Please respond to me directly since I've not
> joined the reflector. -- thanks.)
> =============
> <frameset rows="64,*">
>    <frame   name="banner" scrolling="no"
>          noresize="noresize" src="MyAds.htm" />
>    <frameset cols="150,*">
>       <frame name="contents" scrolling="auto"
> src="MyIndex.htm" />
>       <frame name="body" scrolling="auto"
> src="http://www.newyorktimes.com" />
>    </frameset>
> </frameset>
> ==============
>
> --
> Jim Isaak
> Internet/Standards Strategist
> +-----------------------------------------------
> J.Isaak@Computer.org http://www.JimIsaak.com
> Candidate for the IEEE Board of Directors:
>    www.ieee.org/organizations/corporate/divVIII.htm
> Chair: Internet Best Practices Standards Committee
>    http://computer.org/standards/Internet
> +-----------------------------------------------
>
>
>
>

Received on Monday, 3 December 2001 14:03:56 UTC