Ricardo wrote:
On May 4, 11:33 am, Olivier Percebois-Garve <perceb...@gmail.com>
wrote:
Hi

I'm puzzled with this :http://pastebin.me/49fef93928aff

(in firebug click on the jquery object, then expand "0")

Using empty() or remove() on the lis of a ul, it seems that jQuery is
"faking" to remove them,
i.e the lis will not be accessible by jQuery anymore, but in reality the
childnodes are still there.
Well, at least that's what I can believe from firebug. (Not sure who's
the liar here jQuery, firebug, or me being dumb)

I'm facing an issue that gets down to that, I really dont understand
whats going on and how to handle it.
(using jQuery 1.2.6)

I hope I am missing the obvious. Am I ?

-Olivier

The LIs you see in Firebug are you the ones you appended at the end of
your script:
$('#u2').append($lis);

The childNodes property is a live collection, it updates as you change
the DOM. Remove the line I mentioned and you'll see the LIs are being
removed correctly, or try appending more items to the list and you'll
see childNodes updating accordingly.

cheers
-- ricardo

Ha !

Thank you very much, "live collection" explains it.
I already did what you said, but I could not make sense out of it.

Is this also solving my other weird issue ? Are object properties also "live" ?
I had properties becoming "undefined" once I click the logged object :

http://www.screencast.com/users/olivvv/folders/Jing/media/7e598646-3bca-4b61-852b-03434f1a689a

-Olivier













Reply via email to