Hi Felix,

I presume you mean you upgraded from 1.1.3 to 1.2.1. The you're
correct about the change being an "anti-memory leak" fix.

You can do one of two things:

1. Use the native "removeChild()" method (
http://developer.mozilla.org/en/docs/DOM:element.removeChild ). This
won't delete the events and will return the "removed child" so you can
cache it for later.

2. Use the jQuery "appendTo()" method and append the elements to a hidden DIV.

Karl Rudd

On Nov 7, 2007 8:46 AM, Felix Geisendörfer <[EMAIL PROTECTED]> wrote:
>
>  Hey,
>
>  I recently upgraded my app from jQuery 1.3.1 to 1.2.1 and the transition
> was incredibly easy.
>
>  However, yesterday I noticed that $().remove() now seems to behave
> differently then it did in 1.3.1. Thats because now it deletes any events
> attached to the element removed. This happens to be a problem in my app b/c
> I remove unneeded elements from the DOM instead of hiding them and inject
> them back in later on. So when they are injected again, they suddenly don't
> "work" anymore : ).
>
>  Now I looked through the manual and it says this is going to be the
> expected behavior in 1.2.2:
>
>  http://docs.jquery.com/Manipulation/remove
>
>  Which confuses me b/c it already seems to be the case in 1.2.1 and I'm also
> wondering how I could remove DOM elements without deleting their events in
> future? I'm also curious about why this change is being made, is it some
> anti-memory leak thingy?
>
>  Thanks a lot,
>  -- Felix
>  --------------------------
>  Blogger: http://www.thinkingphp.org/
>  Entrepreneur: http://www.posttask.com/ -- currently in private beta, ask me
> for invite / password
>  Freelancer: http://www.fg-webdesign.de/
>
>
>  AIM: theundefined87
>  Skype: TimeFor23
>  Other IM: felixge.de
>  Mobile (USA): +1 404 3888693
>  Mobile (GER): +49 162 9391612
>  Twitter: http://twitter.com/felixge

Reply via email to