$("form").submit(function () {
console.log("提交了");
$("input:submit").attr("disabled", "true");
setTimeout(function () {
$("input:submit").removeAttr("disabled");
}, 3000);
});

网上看到老外写的

 // jQuery plugin to prevent double submission of forms
jQuery.fn.preventDoubleSubmission = function() {
$(this).on('submit', function(e) {
var $form = $(this); if ($form.data('submitted') === true) {
// Previously submitted - don't submit again
e.preventDefault();
} else {
// Mark it so that the next submit can be ignored
$form.data('submitted', true);
}
}); // Keep chainability
return this;
}; //Use it like this
$('form').preventDoubleSubmission();

最新文章

  1. 【Java EE 学习 28 上】【oracle学习第二天】【子查询】【集合运算】【几种数据库对象】
  2. Eclipse中的文件导航插件StartExplorer
  3. Codeforces Round #172 (Div. 2)
  4. centos安装gitlab
  5. nodejs技术面试问题整理
  6. 纯css3代码写下拉菜单效果
  7. navagationController 的子控制器如何取消右滑返回
  8. Java面向对象程序设计--与C++对比说明:系列2(类机制)
  9. Wpf ListBox数据绑定实例1--绑定字典集合
  10. MVC WebApi 用户验证 (2)
  11. requireJS 源码(二) data-main 的加载实现
  12. SpringBoot yml 配置
  13. windows下安装oracle11g测试是否成功与监听器问题和网页控制台登录
  14. Centos修改时间为24小时制
  15. JavaScript中直接量和变量
  16. Eloquent JavaScript #02# program_structure
  17. [转] 关于 Ceph PG
  18. C++单例模式的实现及举例
  19. 20135220谈愈敏Blog5_系统调用(下)
  20. Android学习系列(7)--App消息通知机制

热门文章

  1. k8s 基础 核心概念
  2. day18-事务与连接池 4.事务特性
  3. Learning Python 004 基础的数据类型和变量
  4. url中传中文
  5. Sharepoint foundation2013独立安装教程
  6. UPC11073(DP,思维)
  7. Python-OpenCV中的图像轮廓检测
  8. SQL Server 2012安装——.net framework 3.5离线安装
  9. 二维偏序 tree
  10. 洛谷P3128 [USACO15DEC]最大流Max Flow