Q:

jquery live method, how to disable one link and not every link

how can i disable live('click', function...) method and then after ajax call (depending on response), then enable it again?
i read some place that "event.preventDefault();" dont work on live method and even if it works, how can i enable it again? i cant use die('click', function...) method, because it will disable all the links and not just single link, which i clicked on.

A:

lets say you have this code
$('a.clickers').live('click', function() {
    ///...
});

what you would like to do is single out elements when they are clicked.  Handler functions in jquery always have their context set to the element they are processing at the time (i.e. this == anchor element you clicked on).  So we need to use this, and call die on it individually like so.
$('a.clickers').live('click', function clickHandler() {
    // keep a reference to the link that is clicked on so we can refer to it
    // later in the ajax handler.
    var elementClickedOn = this;
    // removes the live event handler
    // from just this link
    $(elementClickedOn).die('click', clickHandler);
    // your code
    // ajax call, im not 100% familiar with ajax in jquery
    // but you get the gist.
    $.ajax(server, function ajaxHandler(responseargs) {
        if (responseargs.reEnableConditionMet) {
            //renable the element's live event handler, by referring to the 
            //original function
            $(elementClickedOn).live('click', clickHandler);
        }
    });
});

I hope this is close to what you were looking for.

