Aktivieren/Deaktivieren des Click-Ereignis für das element mit jQuery

Will ich Aktivieren/Deaktivieren, klicken Sie auf event-on-element. Ich habe folgenden code...

HTML:

<a id="CP" style="cursor: pointer; text-decoration: underline;">Current Processes</a>

jQuery:

$(document).on("click", "#CP", function(event) {
    $this = $(this);
    $this.click(function() {
        return false;
    });
    $this.html("Processing...").css({
        "text-decoration": "none",
        "cursor": "default"
    });
    $.ajax({
        type: 'post',
        url: 'abc.jsp',
        success: function(process) {
            //My code goes here...
            $this.on("click"); // Here i want to bind or add handler which is fired previously.
        }
    });
});
set href="#" und zu entfernen, dass cursor: pointer . Sie sind mit einem anchor wie ein div
warum wollen Sie das tun? ist es, Sie wollen nur anmelden, wird die Veranstaltung einmal? wenn das der Fall ist, dann können Sie die one Ereignis api.jquery.com/one

InformationsquelleAutor Rickyrock | 2013-07-03

Schreibe einen Kommentar