Javascript countdown (desktop notification)

Source: Internet
Author: User

Javascript countdown (desktop notification)

This article describes how to implement the countdown Effect of javascript. Share it with you for your reference. The details are as follows:

After the weekend, we have a countdown to work and have fun.

Make sure the following three points:

1. HTML5 desktop notifications have been enabled for non-ie browsers in Chrome versions. For specific settings, see the following
2. Place the HTML file on the Local Web server for testing. Double-click it to run it. A desktop notification cannot be displayed.

By the way, this program can easily be extended to timed notifications.

There are two tangled points in the process of doing this:

1. parseInt ("09") returns 0. The correct method is parseInt ("09", 10), explicitly specifying the base number as decimal
2. false and "false". This is also a bit difficult.
$ ("# Minute"). attr ("readonly", "false ");
But it does not reach the effect. In fact, the readonly attribute only has two values: true or false. Therefore, if I set its value to "false ", it is equivalent to setting (convert a non-null string to a Boolean value ):
$ ("# Minute"). attr ("readonly", true );


I fixed some bugs and realized that the sentence "It seems very simple and not so easy".

Shows the running effect:

<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" ""> 

I hope this article will help you design javascript programs.

Related Article

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: 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.