You can store data in the class attribute. See the jquery.metadata
plugin: http://docs.jquery.com/Plugins/Metadata. You can also use the
data() method in jQuery, it's meant for this.
- ricardo
On Mar 31, 6:42 pm, Eric Garside wrote:
> Right, but the problems with that approach is inefficiency.
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 think it depends upon the context.
If the loop is needed fo
On Tue, Mar 31, 2009 at 5:42 PM, Eric Garside 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);
W
On Apr 1, 7:42 am, Eric Garside 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/re
That approach is only more efficient because the original design was
lacking.
Also, you can just use the starts(^) attribute selector $("div
[id^='event-phase']")
to retrieve all IDs that start with 'event-phase'.
You don't get to make up new meaning for existing attributes because
you think it s
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 ascr
Is there any major problems you're aware of with this kind of dom
pollution that have a negative impact on ease or performance?
My thoughts:
Firstly: Validate!
But I think that negative impact on whatever isn't the point.
Suppose:
Option 1 - Heading level 1
Option 2 - Heading level 1
What opt
2009 1:57 PM
> To: jQuery (English)
> Subject: [jQuery] Re: A general Javascript question: duplicate IDs in a
> document?
>
> A best practice I've adopted is to utilize classes and ref/rel attributes on
> dom elements for situations like you're describing.
>
>
>
1:57 PM
To: jQuery (English)
Subject: [jQuery] Re: A general Javascript question: duplicate IDs in a
document?
A best practice I've adopted is to utilize classes and ref/rel attributes on
dom elements for situations like you're describing.
Instead of
On Mar 31, 12:31 pm, bri
A best practice I've adopted is to utilize classes and ref/rel
attributes on dom elements for situations like you're describing.
Instead of
On Mar 31, 12:31 pm, brian wrote:
> An ID should be unique. That's why it's callled an ID (IDentifier).
> Repeating an ID in a page will cause
An ID should be unique. That's why it's callled an ID (IDentifier).
Repeating an ID in a page will cause problems for any DOM work.
For your purposes, you might do something like:
On Tue, Mar 31, 2009 at 12:24 PM, riotbrrd wrote:
>
> I realize this is not jQuery specific, but I figured yo
It's against the W3c spec for the DOM. The whole point of an ID is that it's
unique on the page. Duplicate IDs lead to potential errors.
If you need to have more than one of a thing on a page, then use a class.
-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@google
12 matches
Mail list logo