Why does he even need a namespace... (function ( ) { var bigDataObject = {}; el.onclick = function(){/*can use the object*/}; })();
2011/9/29 Šime Vidas <sime.vi...@gmail.com>: >> In my opinion discard the data, saving the cost of a DOM access. > > Afaik, setting/getting .data() does not include an additional > performance penalty (as in page reflow), since jQuery's global cache > object is used to store the data. > > If a reference to the DOM element exists beforehand, ergo, no selector > query is performed, then: > > $( elem ).data( 'arr', arr ); > > and > > $( elem ).data( 'arr' ); > > perform well. > > -- > To view archived discussions from the original JSMentors Mailman list: > http://www.mail-archive.com/jsmentors@jsmentors.com/ > > To search via a non-Google archive, visit here: > http://www.mail-archive.com/jsmentors@googlegroups.com/ > > To unsubscribe from this group, send email to > jsmentors+unsubscr...@googlegroups.com > -- To view archived discussions from the original JSMentors Mailman list: http://www.mail-archive.com/jsmentors@jsmentors.com/ To search via a non-Google archive, visit here: http://www.mail-archive.com/jsmentors@googlegroups.com/ To unsubscribe from this group, send email to jsmentors+unsubscr...@googlegroups.com