swal({
  title: "确认删除?",
  text: "Your will not be able to recover this imaginary file!",
  type: "warning",
  showCancelButton: true,
  confirmButtonColor: "#DD6B55",
  confirmButtonText: "确认",
  cancelButtonText: "取消",
  closeOnConfirm: false,
  closeOnCancel: false
},
function(isConfirm){
  if (isConfirm) {
    swal("Deleted!", "Your imaginary file has been deleted.", "success");
  } else {
    swal("Cancelled", "Your imaginary file is safe :)", "error");
  }
}); function edit(){
    swal({
        title: "编辑订单",
        text: "修改订单金额",
        type: "input",
        showCancelButton:true,
        closeOnConfirm:false,
        confirmButtonText:"确认",
        cancelButtonText:"取消",
        animation: "slide-from-top",
        inputPlaceholder: "输入订单金额"
    },
    function (inputValue){
        if(inputValue){
            var re = /^[1-9]+[0-9]*]*$/;
            if(!re.test(inputValue)){
                swal("订单金额只能是一个正整数");
            }else{
                swal(inputValue);
            }
                
        }else{
            swal("输入不能为空");
            
        }
    }
    
    );
}

可参考地址:

http://www.dglives.com/demo/sweetalert-master/example/

 
 

swal用法的更多相关文章

  1. swal() 弹出层的用法

    swal()方法是一个提示框: swal({ title: "", text: "请扫描用户手机上的付款码", type: "input", ...

  2. EditText 基本用法

    title: EditText 基本用法 tags: EditText,编辑框,输入框 --- EditText介绍: EditText 在开发中也是经常用到的控件,也是一个比较必要的组件,可以说它是 ...

  3. jquery插件的用法之cookie 插件

    一.使用cookie 插件 插件官方网站下载地址:http://plugins.jquery.com/cookie/ cookie 插件的用法比较简单,直接粘贴下面代码示例: //生成一个cookie ...

  4. Java中的Socket的用法

                                   Java中的Socket的用法 Java中的Socket分为普通的Socket和NioSocket. 普通Socket的用法 Java中的 ...

  5. [转载]C#中MessageBox.Show用法以及VB.NET中MsgBox用法

    一.C#中MessageBox.Show用法 MessageBox.Show (String) 显示具有指定文本的消息框. 由 .NET Compact Framework 支持. MessageBo ...

  6. python enumerate 用法

    A new built-in function, enumerate() , will make certain loops a bit clearer. enumerate(thing) , whe ...

  7. [转载]Jquery中$.get(),$.post(),$.ajax(),$.getJSON()的用法总结

    本文对Jquery中$.get(),$.post(),$.ajax(),$.getJSON()的用法进行了详细的总结,需要的朋友可以参考下,希望对大家有所帮助. 详细解读Jquery各Ajax函数: ...

  8. 【JavaScript】innerHTML、innerText和outerHTML的用法区别

    用法: <div id="test">   <span style="color:red">test1</span> tes ...

  9. chattr用法

    [root@localhost tmp]# umask 0022 一.chattr用法 1.创建空文件attrtest,然后删除,提示无法删除,因为有隐藏文件 [root@localhost tmp] ...

随机推荐

  1. HDU3394 Railway —— 点双联通分量 + 桥(割边)

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3394 Railway Time Limit: 2000/1000 MS (Java/Others)   ...

  2. IIS application pool access desktop denied

    https://stackoverflow.com/questions/5437723/iis-apppoolidentity-and-file-system-write-access-permiss ...

  3. 简单记录CentOS服务器配置JDK+Tomcat+MySQL

    项目需要部署到一台CentOS的服务器之上,之前这台服务器上面已经安装了一个Nginx和MySQL,跑的是PHP环境,有一个项目正在运行.而我们最新的项目是用Java写的,服务器是用的Tomcat,所 ...

  4. 276D

    贪心 想了一会觉得没什么很好的方法,看了题解 我们枚举每个二进制位,对于l,r如果这位相同就异或到答案里,否则停止,这里肯定是r比l大,也就是r这位是1而l是0,那么我们就让r这位选1,l选0,然后把 ...

  5. Pascal之计算小系统

    program Project16; {$APPTYPE CONSOLE} VAR n,i,k,score,b,a:integer; answer,c:real; ch:char; Begin rep ...

  6. property_get 与 property_set 的返回值(转载)

    转自:http://wzw19191.blog.163.com/blog/static/13113547020103218265162/ /* property_get: returns the le ...

  7. PCB RabbitMQ的安装使用

    随着公司加大力度信息化建设,PCB企业各种各样的系统软件越来越多,整个公司订单流状态监控变得越来越不可控,是时候需采用新的方式来收集各系统状态节点状态了,以下记录RabbitMQ安装使用: 一.Rab ...

  8. bzoj 4820: [Sdoi2017]硬币游戏【kmp+高斯消元】

    有点神,按照1444的做法肯定会挂 注意到它的概率是相同的,所以可以简化状态 详见http://www.cnblogs.com/candy99/p/6701221.html https://www.c ...

  9. bzoj 1180: [CROATIAN2009]OTOCI【LCT】

    一道几乎是板子的LCT,但是沉迷数学很久时候突然1A了这道题还是挺开心的 #include<iostream> #include<cstdio> using namespace ...

  10. CCF2016.4 - B题

    思路:创建两个bool数组来模拟下落过程,一个存放面板状态,一个存放下落的格子.检测格子和面板对应位置是否同时为True,如果是则有冲突,不能继续下落,否则增加行号.为了统一处理,我们把面板最下面加一 ...