A pattern I use quite often within my JS classes is to store relevant
DOM nodes as a property on the class.

e.g.

function Sprite(dom, html) {
  this.dom = dom;
}

Sometimes it would be convenient to store the jQuery instance bound to
this node, e.g. :

function Sprite(dom, html) {
  this.$dom = $(dom);
}

I've always avoided doing this as I was concerned about memory, GC and
storing a 'whole' jQuery obect for each reference. However, I realise
that this is entirely superstitious and was wondering if anyone knew
whether it was good/bad for GC/memory/style.

Thanks

weepy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to