|
In the initialization of the page pop-up message box, this and background message push is not the same, just load the page to query some data and then through the form of pop-up box to display: to achieve the purpose of prompting the user attention.
First to download the Jquery.messager.js plug-in, the introduction of JS
<scripttype= "Text/javascript" src= "<%=request.getcontextpath ()%>/javascript/jquery-1.8.2.js" ></ Script>
<scripttype= "Text/javascript" src= "<%=request.getcontextpath ()%>/javascript/jquery.messager.js" > </script>
Here is a simple jquery ajax submission:
$ (function() {
$.messager.lays (200, 150);//define message box size
$.ajax ({
URL: ' Ydxxshblh_ydxxshcount.do ',
Success:function(res) {
var count=$.json (res). Json.count;
$.messager.show ("Prompt Information", ' You have a ' +count+ ' case will expire, please deal with it as soon as possible.) ', 3000);
}
});
});
3000 means that the message box will appear for 3 seconds, and you can define it yourself, note: If this argument is 0, then the message box will not disappear itself, you have to click the fork to close.
You define how the message box pops up
$.messager.anim (' fade ', 1000);//show,slide
This method is to define the form of a message box pop-up, if there is no default is to move up from the bottom up fade is gradually appear, show is slide is sliding, default is slide way, the following is the default initialization:
this. Original = function() {
this. Layer = {
' Width ': 200,
' Height ': 100
};
this. title = ' Informational hint ';
this. Time = 4000;
this. anims = {
' Type ': ' Slide ',
' Speed ': 600
};
};
|