Jquery message plug-in-QQ message-like pop-up notification

Source: Internet
Author: User
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/

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.