[jQuery] remove() deletes events in jQuery 1.2.1. Why?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
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:
<a href="http://docs.jquery.com/Manipulation/remove">http://docs.jquery.com/Manipulation/remove</a>
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
<small>
--------------------------
Blogger: <a href="http://www.thinkingphp.org/">http://www.thinkingphp.org/</a>
Entrepreneur: <a href="http://www.posttask.com/">http://www.posttask.com/</a>
<em>-- currently in private beta, ask me for invite / password</em>
<del>Freelancer: <a href="http://www.fg-webdesign.de/">http://www.fg-webdesign.de/</a></del>
</small>
<table style="font-size: 90%;">
<tbody>
<tr style="text-align: left;">
<th>AIM:</th>
<td>theundefined87</td>
</tr>
<tr style="text-align: left;">
<th>Skype:</th>
<td>TimeFor23</td>
</tr>
<tr style="text-align: left;">
<th>Other IM:</th>
<td><a href="http://felixge.de/">felixge.de</a></td>
</tr>
<tr style="text-align: left;">
<th>Mobile (USA):</th>
<td>+1 404 3888693</td>
</tr>
<tr style="text-align: left;">
<th>Mobile (GER):</th>
<td>+49 162 9391612</td>
</tr>
<tr style="text-align: left;">
<th>Twitter:</th>
<td><a href="http://twitter.com/felixge">http://twitter.com/felixge</a></td>
</tr>
</tbody>
</table>
</body>
</html>