Very helpful, thanks for the response.
Paul

On Aug 28, 12:16 pm, "Richard D. Worth" <[EMAIL PROTECTED]> wrote:
> Some downsides to using expandos (arbitrary attribute key/value pairs on
> DOMElements):
>
> 1) possible memory leaks
> 2) keyname choice is limited because of built in attributes/properties
> 3) have to be careful about what you stick in there (see 1). Best to stick
> with simple values, ints and strings
>
> jQuery solves these by putting at most 1 expando on each element. The value
> is an int, so it's safe from memory leaks. The attribute key is prefixed
> with 'jquery' so there's no naming collision. Then the object store/cache is
> completely external to the DOMElement itself. It's as easy to use as
> .attr(); just substitute .data().
>
> - Richard

Reply via email to