推荐一款好用的alert,下面地址是demo,很直观的看到效果,wap可以使用
http://www.dglives.com/demo/sweetalert-master/example/
<script src="~/Scripts/jquery.min.js"></script>
<link href="~/Content/sweetalert.css" rel="stylesheet" /> <script src="~/Scripts/sweetalert.min.js"></script> //text:内容 //timer:显示时间 //type:图标类型:success,info,warning 默认info //title:标题 可不填 默认:系统提示 function AlertCustom(text, timer, url, type, title) { var type = arguments[3] || "info"; var title = arguments[4] || "系统提示"; var data = { title: title, text: text, type: type,//success,info,warning timer: timer, showConfirmButton: false, html: true }; swal(data); if (url != "" && url != undefined && url != null) { setTimeout(function () { window.location.href = url; }, timer); } }//使用方法AlertCustom('请求验证码失败!', 2000);