js 防止按钮重复点击 var flag= 0; $('xxx').click(function () { if (flag == 0) { flag= 1; //... setTimeout(function () { flag= 0 }, 3000); } });