ajax防止重複提交

$.ajax({   url : "{:U('public/register')}",   type : 'POST',   data : {      linkid          :   $('input[name=linkid]').val(),      code       :   $('input[name=code]').val(),      cpassword      :   $('input[name=cpassword]').val(),      password       :   $('input[name=password]').val(),      reccode        :   $('input[name=reccode]').val(),      tradepassword  :   $('input[name=tradepassword]').val(),      username       :   $('input[name=username]').val(),      qq             :   $('input[name=qq]').val(),      phone          :   $('input[name=phone]').val(),   },   beforeSend : function(){      $('#submit').attr('disabled','disabled');   },   success : function(json){      if(json.sign==1){         alt('恭喜您註冊成功,感謝您的加入!');         var url = json.url?json.url:"{:U('Home/Index/index')}";         // window.location.href= url;         setTimeout("rdirect('"+url+"')", 1500);            $('#submit').attr('disabled',false);      }else{            $('#submit').attr('disabled',false);           alt(json.message);      }   }})
相關文章
相關標籤/搜索