第一步 引入所需样式和JS文件

1
2
3
4
<
link 
rel
=
"stylesheet" 
type
=
"text/css"  
href
=
"easyui/themes/default/easyui.css"
>
<
link 
rel
=
"stylesheet" 
type
=
"text/css" 
href
=
"easyui/themes/icon.css"
>
<
script 
type
=
"text/javascript" 
src
=
"easyui/jquery.min.js"
></
script
>
<
script 
type
=
"text/javascript" 
src
=
"easyui/jquery.easyui.min.js"
></
script
>

第二步 编写消息提示框

函数说明:

$.messager.alert

title, msg, icon, fn

显示一个提示窗口。参数:
title
显示在头部面板的标题文字。
msg
显示的消息文字。
icon
显示图标的图片。可用的值是: errorquestioninfowarning
fn
窗口关闭时触发的回调函数。

1
2
3
4
5
6
$().ready(
function
(){
    
//设置消息Messager
    
$.messager.alert(
'标题'
,
'Hello Word'
,
'error'
,
function
(){
        
alert(
'回掉函数'
);
    
});
});

第三步 效果图