jQuery delegate is not working?
<p>I am trying to use delegate to call a function, when a specific set of links get click.
I have already used it before in some other page. It was worked there. But, this time i even not able to find, where the problem is.</p>

<p>My links were dynamically generated, they looks like</p>

<pre><code>&lt;a class="thumbLink" href="#" id="My HomeTown-1"&gt;&lt;small&gt;My HomeTown&lt;/small&gt;&lt;/a&gt;
</code></pre>

<p>And the jQuery delegate function is,</p>

<pre><code>$(document).ready(function(){
$("#albumHolder").delegate('a.thumbLink', 'click', this.loadAlbum);//albumHolder is div ID that holds all the &lt;a&gt; elements

this.loadAlbum = function(){
    var id = this.id;
    var number = id.lastIndexOf("-");
    var alubmName = id.subString(0, number);
    alert(albumName);
}
});
</code></pre>

<p><strong>Update:</strong></p>

<p>I tried both versions, But i am not able to make it work!</p>

<pre><code>$("#albumHolder").delegate('a.thumbLink', 'click', function loadAlbum(){
    var id = this.id;
    var number = id.lastIndexOf("-");
    var alubmName = id.subString(0, number);
    alert(albumName);
});



   this.loadAlbum(){
    var id = this.id;
    var number = id.lastIndexOf("-");
    var alubmName = id.subString(0, number);
    alert(albumName);
}
$("#albumHolder").delegate('a.thumbLink', 'click', this.loadAlbum);
</code></pre>

<p>The above code is in <code>$(document).ready(function(){});</code>. Is that correct??
i also tried by putting them in a separate <code>js</code> file. I cannot make it work.</p>

<p>Any idea about my problem!!!</p>
