22
rated 0 times
[
23]
[
1]
/ answers: 1 / hits: 91303
/ 15 Years ago, thu, december 17, 2009, 12:00:00
How can I temporarily disable the onclick event listener, (jQuery preferred), after the event has been fired?
Example:
After the user clicks on the button and fires this function below, I want to disabled the onclick listener, therefore not firing the same command to my django view.
$(.btnRemove).click(function(){
$(this).attr(src, /url/to/ajax-loader.gif);
$.ajax({
type: GET,
url: /url/to/django/view/to/remove/item/ + this.id,
dataType: json,
success: function(returned_data){
$.each(returned_data, function(i, item){
// do stuff
});
}
});
Thanks a lot,
Aldo
More From » jquery