Possible Duplicate:
Need to cancel click/mouseup events when double-click event detected
Preventing double-click of Submit button
I have following function
$("#btnSubmit").click(function(){
$("#btnSubmit").attr("disabled", "disabled");
....make ajax request
$("#btnSubmit").removeAttr("disabled");
}
Problem is that I want to handle 1st click of a double click . Or a single click . Because when user double clicks it does run the function twice . If I use .one() it will handle only single clicks . But I also want to handle double clicks but only handle it once . Whats solution ?