When you create a website, you need to implement a function, that is, to regularly refresh the online orders placed by the guests themselves, and then remind them to handle them in a timely manner, just like jquery. messager. JS can help us easily implement this function by querying database records at regular intervals and reminding them through the message plug-in pop-up! ~~
First download the plug-in: plugin !~~
1. First, import the jquery. js and jquery. Message. js files to the page file.
<SCRIPT type = "text/JavaScript" src = "/jquery. js"> </SCRIPT>
<SCRIPT type = "text/JavaScript" src = "/jquery. Messager. js"> </SCRIPT>
2. Write a function to query the number of database records in the. CS file.
3. Write JS on the pageCodeTo implement scheduled Query
Function getordercount ()
{
$. Ajax ({
Type: "Get ",
Datatype: "html ",
URL: "/jquery/ashx/order. ashx ",
Data :"",
Success: function (data ){
If (data> 0)
{
$. Messager. anim ('fade, 2000 );
$. Messager. show ('<font color = Red> customer Self-service Ticket reminder </font> ', 'You still have <font color = Red> '+ Data +' </font> Self-Help tickets not handled. Please handle them as soon as possible! <A href = order. aspx target = _ blank> enter processing </a> ', 10000 );
}
}
});
}
$ (Document). Ready (function (){
Getordercount ()
Window. setinterval ("getordercount ()", 60000); // refresh once every 1 minute
});
Online Demo: http://www.corrie.net.cn/demo/messager/