jQuery selectors after dynamic reload, and $(this)
<p>I need some help. I load a list of entries in a div every 5 seconds. Each entry is a div and has a unique ID. Like this:</p>

<pre><code>&lt;div class="entry"&gt;
&lt;div class="textbox"&gt;
    &lt;p class="entry-text"&gt;
        &lt;?php echo $text;?&gt;
    &lt;/p&gt;
&lt;/div&gt;
&lt;div class="infobox"&gt;
    &lt;p class="date"&gt;&lt;a #&lt;?php echo $id;?&gt; id="&lt;?php echo $id;?&gt;" href="gen_details.php?id=&lt;?php echo $id;?&gt;"&gt;&lt;?php echo $t;?&gt;&lt;/a&gt; &lt;/p&gt;
    &lt;p class="ip"&gt;&lt;?php echo $ip;?&gt;&lt;/p&gt;
&lt;/div&gt;
</code></pre>

<p></p>

<p>These, as I said are loaded each 5 seconds. I'm adding a details page for every entry, with this:</p>

<pre><code>                $('.date a').click(function () {
                var dataString = 'id=' + $(this).attr("id"); 
                //alert(dataString);
                $.ajax({
                    type: "POST",
                    url: "gen_details.php",
                    data: dataString,
                    success: function(data) {
                        $("#content").hide().fadeOut('fast');
                        $("#content").html(data).show('fast');
                        refresh = 0;
                    },
                });
                return false;
            });
</code></pre>

<p>This works perfectly fine, until it reloads. It seems to lose the handle for the a href and instead of doing the procedure it goes to gen_details.php</p>

<p>I have tried to use .on() but I don't know how would I get the ID of the entry using .on(), as I cant use $(this) (afaik).</p>

<p>I hope I explained my problem at least half-well. English is not my first language so it wasn't that easy.</p>

<p>Thanks in advance.</p>
