siyuan7657

<div class="btn-wrap">

<div id="btn" class="btn">提交</div>
</div>

 

$.ajax({
type:\'post\',
url:\'../../../maintain/addConsult\',
dataType:\'json\',
data:{title:title,question:question,check1:check1,check2:check2,id:id},
async:false,
beforeSend: function () {
//1.让提交按钮失效,以实现防止按钮重复点击
$(".btn").attr(\'disabled\', true);
//2.给用户提供友好状态提示
$(".btn").text(\'提交中...\');
},
complete: function () {
//3.让登陆按钮重新有效
$(".btn").removeAttr(\'disabled\');
},
success:function(data){
if(data>0){
//sessionStorage.setItem(\'jump\', \'jump\');
window.history.back(-1);
}else{
alert("咨询失败");
}
}
})

分类:

技术点:

相关文章:

  • 2021-11-12
  • 2021-11-12
猜你喜欢
  • 2021-06-10
相关资源
相似解决方案