Bugs with jquery.live()?
<p>Can anyone explain to me what's going on?</p>

<p><a href="http://jsfiddle.net/K5yvp/2/" rel="nofollow">http://jsfiddle.net/K5yvp/2/</a></p>

<p>So the way to "achieve" the bugs is :</p>

<ul>
<li>Click Show Parent or Show Parent 2</li>
<li>Click Next to alert</li>
<li>Click Hide to hide (I even remove the contents with html(''))</li>
<li>Click Show Parent or Show Parent 2 again</li>
<li>Click Next</li>
<li>Bam! Two alerts occur!</li>
<li>Repeat for more and more alerts to occur</li>
</ul>

<p>I know the codes I wrote in fiddle is no good, since it's just a simplified version of the problem I found out yesterday. So basically what I meant to do is :</p>

<ul>
<li>Show Parent and Show Parent 2 are actually a button to call AJAX to show contents of albums (can be more than 2 of course)</li>
<li>The &lt; p class="next">Next &lt; /p> is the representation of the data returned from the AJAX request.</li>
<li>Each of this data can be clicked to do something along with the data returned from the AJAX. On this fiddle, I simply alert 'aaa ' with the title of the Show Parent/ Show Parent 2 (supposed to be "albums"). That's why I include the jquery click event INSIDE the show click event since I need the data passed by the AJAX which is requested inside the show click event (hope this is clear enough)</li>
</ul>

<p>I've tried some ways to solve this but it's still quite bugging me that my codes are generating bugs(?) . Some of them are :</p>

<ul>
<li>Change $('.parent').html(''); to $('.parent').remove(); but of course the div class parent will be gone and I will have to recreate it which is not what I want. Maybe I can do $('.parent *').remove(); to remove all elements inside the parent div, but it's the last resort for me. It's a confusing one since firebug only shows one instance of the &lt; p class="next"> exists at one time.</li>
<li>Move the next click event outside the show click event. The show click event will store the data returned by AJAX request in a certain div, and the next click event will get the data from this div. A workaround but is there a better way?</li>
</ul>

<p>Hope this is clear enough. Thanks!</p>
