本文共 747 字,大约阅读时间需要 2 分钟。
</script> ajax中怎么替换alert框 <form class="form-horizontal" role="form" id="userAddForm"> 。。。。 </form> $("#userAddForm").submit(function(e){ e.preventDefault(); data=$(this).serialize(); var id = $("#room_number option:selected").val(); $.ajax({ "url" : "rest/user/"+id+"/addUser", "type" : "post", "dataType" : "text", "data" : data, "success":function(e){ swal({ title: "开户 <small>成功</small>!", text: 'A custom <span style="color:#F8BB86">success<span> message.', html: true }); }, "error" : function(e){ alert("保存失败"); swal({ swal("Oops...", "Something went wrong!", "error");s }); } }); }); $("#cancel").click(function(e){ location.href="rest/user/to_addUser"; }); }); 转载地址:http://qpiti.baihongyu.com/