Jquery disable link for 5 seconds
- by John
I have this code:
$('#page-refresh').click( function() {
$.ajax({
url: "/page1.php",
cache: false,
dataType: "html",
success: function(data) {
$('#pagelist').html(data);
}
});
return false;
});
In this code is it possible that on the ajax success function it disables the #page-refresh click for 5 seconds then re-enable it? Basically if a person clicks the button and this action happens I dont want them to click and run this action again for another 5 seconds. I looked at delay() to unbind the click for this then bind it again but once it unbinded it never allowed me to click the button anymore.