博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
sweetalert
阅读量:4148 次
发布时间:2019-05-25

本文共 747 字,大约阅读时间需要 2 分钟。

 
  • An HTML message

 
 
 </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/

你可能感兴趣的文章
实验5-8 综合练习
查看>>
第2章实验补充C语言中如何计算补码
查看>>
深入入门正则表达式(java) - 命名捕获
查看>>
使用bash解析xml
查看>>
android系统提供的常用命令行工具
查看>>
【Python基础1】变量和字符串定义
查看>>
【Python基础2】python字符串方法及格式设置
查看>>
【Python】random生成随机数
查看>>
【Python基础3】数字类型与常用运算
查看>>
Jenkins迁移jobs
查看>>
【Python基础4】for循环、while循环与if分支
查看>>
【Python基础5】列表和元组
查看>>
【Python基础6】格式化字符串
查看>>
【Python基础7】字典
查看>>
【Python基础8】函数参数
查看>>
【Python基础9】浅谈深浅拷贝及变量赋值
查看>>
Jenkins定制一个具有筛选功能的列表视图
查看>>
【Python基础10】探索模块
查看>>
【Python】将txt文件转换为html
查看>>
[Linux]Shell脚本实现按照模块信息拆分文件内容
查看>>