swal用法
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用法的更多相关文章
- swal() 弹出层的用法
swal()方法是一个提示框: swal({ title: "", text: "请扫描用户手机上的付款码", type: "input", ...
- EditText 基本用法
title: EditText 基本用法 tags: EditText,编辑框,输入框 --- EditText介绍: EditText 在开发中也是经常用到的控件,也是一个比较必要的组件,可以说它是 ...
- jquery插件的用法之cookie 插件
一.使用cookie 插件 插件官方网站下载地址:http://plugins.jquery.com/cookie/ cookie 插件的用法比较简单,直接粘贴下面代码示例: //生成一个cookie ...
- Java中的Socket的用法
Java中的Socket的用法 Java中的Socket分为普通的Socket和NioSocket. 普通Socket的用法 Java中的 ...
- [转载]C#中MessageBox.Show用法以及VB.NET中MsgBox用法
一.C#中MessageBox.Show用法 MessageBox.Show (String) 显示具有指定文本的消息框. 由 .NET Compact Framework 支持. MessageBo ...
- python enumerate 用法
A new built-in function, enumerate() , will make certain loops a bit clearer. enumerate(thing) , whe ...
- [转载]Jquery中$.get(),$.post(),$.ajax(),$.getJSON()的用法总结
本文对Jquery中$.get(),$.post(),$.ajax(),$.getJSON()的用法进行了详细的总结,需要的朋友可以参考下,希望对大家有所帮助. 详细解读Jquery各Ajax函数: ...
- 【JavaScript】innerHTML、innerText和outerHTML的用法区别
用法: <div id="test"> <span style="color:red">test1</span> tes ...
- chattr用法
[root@localhost tmp]# umask 0022 一.chattr用法 1.创建空文件attrtest,然后删除,提示无法删除,因为有隐藏文件 [root@localhost tmp] ...
随机推荐
- Package vim is not available, but is referred to by another package及我的vim配置
新安装的ubuntu,先安装vim,但是安装出现 Reading package lists... Done Building dependency tree Reading state inform ...
- Buildroot 龙芯1C支持指南
本文转载自:https://github.com/pengphei/smartloong-sphinx/blob/master/source/cn/loongson1c_buildroot_guide ...
- Ubuntu redmine 安装
/******************************************************************** * Ubuntu redmine 安装 * 说明: * 随着 ...
- I.MX6 DNS 查看、修改方法
/************************************************************************** * I.MX6 DNS 查看.修改方法 * 说明 ...
- java对象序列化的理解
1.java中的序列化时transient变量(这个关键字的作用就是告知JAVA我不可以被序列化)和静态变量不会被序列 化(下面是一个测试的例子) (实体带versionUUID,便 ...
- bzoj 2006 超级钢琴 —— ST表
题目:https://www.lydsy.com/JudgeOnline/problem.php?id=2006 本来应该是可以用主席树,找区间最小值,取出来后再找那段区间的次小值...... 但也可 ...
- 洛谷P1527 矩阵乘法——二维树状数组+整体二分
题目:https://www.luogu.org/problemnew/show/P1527 整体二分,先把所有询问都存下来: 然后二分一个值,小于它的加到二维树状数组的前缀和里,判断一遍所有询问,就 ...
- [转]Python3 字典 items() 方法
原文Python3 字典 items()方法 描述 Python 字典 items() 方法以列表返回可遍历的(键, 值) 元组数组. 语法 items()方法语法: dict.items() 参数 ...
- 转:IIS MVC 发布错误 403.14-Forbidden Web 服务器被配置为不列出此目录的内容
访问网址:http://blog.csdn.net/csethcrm/article/details/37820135 有两个地方需要配置: 1.web.config中的节点: <system. ...
- Linux之旅第一篇-目录结构及操作目录
一.引言 Linux对java开发来说也是一项必备的技能,因为项目基本都是部署在Linux操作系统的服务器中,虽然项目不一定需要我们去部署,但不管是自己测试环境部署,还是一些生产环境中日志的查看,Li ...