Version 1.0.3.  Also, yahoo rewrote my syntax there a bit - those yes/no links
should actually be written out:

$('#question').append($('<a id="yes" href="#" class="answer">Yes</a> / <a
id="no" href="#" class="answer">No</a>'));

...hopefully that won't get rewritten :)

Jeff

--- Brandon Aaron <[EMAIL PROTECTED]> wrote:

> Which version/revision of jQuery are you using?
> 
> --
> Brandon Aaron
> 
> On 12/7/06, Jeff Ober <[EMAIL PROTECTED]> wrote:
> > I'm getting a memory leak in this function, which iterates over a series of
> > items in the object allSections, showing a question set in the object and a
> > yes/no answer, which then get inserted in an array of results.  In Drip
> > (memory leak finder for IE), I'm seeing the anchors (with the class
> > 'answer') as leaking.  I've tried unbinding them at the beginning of the
> > function, before they are destroyed (with just a
> > $('.answer').unbind('click')), but they still show up as lost dom objects
> > and they show as having an empty function object as their onclick property.
> > I can't think what I'm missing...
> >
> > function showQuestion(qIndex) {
> >         $('.answer').unbind('click');
> >         if (typeof allSections[qIndex] != 'undefined') {
> >                 var category = allSections[qIndex];
> >                 if (category.title == 'Basics') {
> >                         indicesChosen.push(qIndex);
> >                         qIndex++;
> >                         showQuestion(qIndex);
> >                 }
> >                 else {
> >                         $('#index').empty().html('Question
> > '+(qIndex)+' of '+(allSections.length-1));
> >                         $('#question').empty().html(category.question+' ');
> >                         $('#question').append($('Yes / No'));
> >                         $('.answer').click(function() {
> >                                 if ($(this).html() == 'Yes') {
> >                                         indicesChosen.push(qIndex);
> >                                 }
> >                                 qIndex++;
> >                                 showQuestion(qIndex);
> >                         });
> >                 }
> >         }
> >         else
> >                 completeWizard();
> > }
> >
> >  ________________________________
> > Have a burning question? Go to Yahoo! Answers and get answers from real
> > people who know.
> > _______________________________________________
> > jQuery mailing list
> > [email protected]
> > http://jquery.com/discuss/
> >
> >
> >
> 
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
> 



 
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to