js避免快速点击

通过JavaScript避免按钮快速被点击,有一般都是通过修改状态,然后延迟恢复状态来弄的,demo如下:

1
2
3
4
5
6
7
8
onRefresh: function () {
$("button[name='refresh']").attr('disabled', true);
$('#jar-debug-table').bootstrapTable('removeAll');
getAllClass();
setTimeout(function () {
$("button[name='refresh']").attr('disabled', false);
}, 3000);
}
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×