JavaScript Alert通用美化类
时间:2024-04-27 15:20:50
function sAlert(msg,boxtype,func,msgtitle)
sAlert('信息内容',1,'','信息标题')
@msg:提示信息内容
@boxtype:1为弹出框,2为确认框,3为提示框
@func:点确认时执行的函数
@title:信息框标题文字内容
只有msg是必须的,后面的参数可以省略。如果中间的参数为空则在对应位置上''或者""表示(根据实际情况选择单双引号)
调用此方法须在每个使用的页面的head区域加入下面代码。
<script type="text/javascript" src="alert1/alert.js" src="alert1/alert.js"></script>
<link href="alert1/alert.css" href="alert1/alert.css" rel="stylesheet" type="text/css" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN"> <head> <title>弹出框测试页面</title> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <meta http-equiv="Content-Language" content="gb2312" /> <style type="text/css"></style> <script type="text/javascript"></script> </head> <body> <div id="msgRun"> <div> <h5 >宠物专用信息框实例:</h5> <input type="button" value="弹出框" onclick="sAlert('测试效果2',1);" /> <input type="button" value="确认框" onclick="sAlert('确认框',2,'','宠我宝贝');" /> <input type="button" value="提示框" onclick="sAlert('提示框');" /> </div> <h4>function sAlert(msg,boxtype,func,title)</h4> <ul> <li >sAlert('信息内容',1,'','信息标题')</li> <li >@msg:提示信息内容</li> <li >@boxtype:1为弹出框,2为确认框,3为提示框</li> <li >@func:点确认时执行的函数</li> <li >@title:信息框标题文字内容</li> <li >只有msg是必须的,后面的参数可以省略。如果中间的参数为空则在对应位置上''或者""表示(根据实际情况选择单双引号)</li> <li >调用此方法须在每个使用的页面的head区域加入下面代码。</li> </ul> <textarea rows="5" cols="60"> <script type="text/javascript" src="alert1/alert.js" src="alert1/alert.js"></script> <link href="alert1/alert.css" href="alert1/alert.css" rel="stylesheet" type="text/css" />
测试环境:可以在下面的文本框里按上面要求的格式函数进行测试:
sAlert('信息内容',1,'location.href="https://www.jb51.net"','信息标题')
标签:Alert,美化类
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
Python调用飞书发送消息的示例
2022-10-20 14:21:23
在golang中操作mysql数据库的实现代码
2024-01-15 14:41:51
如何通过shell脚本自动生成vue文件详解
2024-05-22 10:28:35
![](https://img.aspxhome.com/file/2023/1/123701_0s.jpg)
vue调用高德地图实例代码
2024-06-07 15:20:47
![](https://img.aspxhome.com/file/2023/9/123019_0s.png)
asp+jsp+JavaScript动态实现添加数据行
2023-07-03 05:37:15
![](https://img.aspxhome.com/file/2023/9/114069_0s.png)
Python如何实现定时器功能
2023-04-13 23:19:28
ODBC的保留字有哪些?
2009-10-28 18:34:00
关注前端开发流程
2009-12-31 17:38:00
推荐一款高效的python数据框处理工具Sidetable
2022-07-22 04:34:25
![](https://img.aspxhome.com/file/2023/8/83768_0s.png)
python apscheduler cron定时任务触发接口自动化巡检过程
2023-01-04 19:52:50
![](https://img.aspxhome.com/file/2023/2/111972_0s.jpg)
Python同时处理多个异常的方法
2021-12-24 11:20:56
使用DW中遇到的常见问题详解
2008-03-18 16:27:00
使用npm命令提示: 'npm' 不是内部或外部命令,也不是可运行的程序的处理方法
2024-05-13 09:29:36
![](https://img.aspxhome.com/file/2023/8/125728_0s.png)
CentOS 7.6安装MySQL 5.7 GA版的教程图解
2024-01-27 11:47:48
![](https://img.aspxhome.com/file/2023/7/118247_0s.png)
Jupyter 无法下载文件夹如何实现曲线救国
2023-01-12 10:28:52
![](https://img.aspxhome.com/file/2023/1/114651_0s.jpg)
解密Python中的描述符(descriptor)
2023-12-05 08:28:48
JS应用正则表达式转换大小写示例
2024-04-26 17:11:14
Python中的数学运算操作符使用进阶
2021-05-24 16:05:46
9个个人网站制作诀窍
2007-12-13 11:36:00
Python 设计模式行为型访问者模式
2023-10-18 14:44:52
![](https://img.aspxhome.com/file/2023/5/68465_0s.png)