views:

12

answers:

1

I have the following script which works perfectly until I regenerate the links ".resultLink" via jquery ajax:

$("a.resultLink").live('click', function()
{
    var that = this;

    $.ajax({
        url: 'most_used.aspx',
        type: 'POST',
        data: { strMostUsedID:$(that).attr("href") },
        error: function() { },
        success: function() { }
    });
});

"live" normally fixes this for me but this time it did not. Not sure what I am doing wrong.

+1  A: 

The most likely cause I can think of is the selector not matching, double check that the .resultLink class is being applied to the new links...if it's not the .live() handler won't match the selector.

Nick Craver
That was it. Thanks.
oshirowanen