On Apr 1, 7:42 am, Eric Garside <gars...@gmail.com> wrote:
> Right, but the problems with that approach is inefficiency. It's more
> efficient to grab the entire set of elements via $('.event-phase') and
> comparing their "rel" attribute than it is to throw a loop around $
> ('.event-phase-' + i);
>
> I use ref/rel for the same basic semantic ideas behind their ascribed
> meaning. In implementations of code I've done, I try and use "ref" for
> any situation where the element is referencing an action or event
> which the element is a target of, and rel for situations where the
> element is referencing a target action or event. I think one of the
> larger problems here is attempting to, efficiently, get enhanced
> functionality out of XHTML, which is still very basic when it comes to
> element properties and relationships of dom elements.

XHTML is just HTML as XML, it doesn't provide an excuse to use invalid
attributes.  There is nothing in the XHTML specification that allows
invalid attributes.  If you want to go to a custom DTD, use XML, which
may lead you to the vagaries of client-side XSLT.

Good luck making that cross-browser!


> It's a shame there isn't a slushy attribute to utilize for storing
> information that has nothing to do with markup or presentation,

There is, it's called "class".

> but
> rather a strong binding to javascript.

All (standard) element attributes are available as DOM properties,
that should be sufficient.  The various specifications are written to
be script language agnostic, which is a good thing even if javascript
is used in almost every case.


> Classes do a decent job for
> identification, but there's no real good element attribute to use for
> configurations of elements. Perhaps sometime in the future there will
> be a configuration attribute we can use for this sort of affair that
> will bring both optimized functionality and strictly valid code.

The class attribute can have multiple values that can be used for
whatever purpose you like.  They just happen to also be used as a CSS
selector (as are other attributes of HTML elements such as ID and tag
name).


--
Rob

Reply via email to