JavaScript-based implementation of simple random lottery applets _ javascript skills

Source: Internet
Author: User
To enable the lottery program to run directly on any machine without the need to configure the platform, the development tools and compilation and running tools can also be as simple as possible (such as text can be edited, window System built-in browser can compile and run the situation), decided to try to use javascript for small programs such as the lottery using tools such as VB, Delphi to achieve more convenient, because I have not installed such an application on my machine, I can only find another method. To enable the lottery program to run on any machine without the need to configure the platform, the development tools and compilation and running tools can also be easily edited (such as text, window System built-in browser can compile and run the situation), decided to try to use javascript. I am not deeply engaged in javascript research. I usually use javascript for website development to determine the validity of client data (based on security considerations, websites with high security requirements should try to use server-side languages to determine the data validity.) the most common methods and functions are involved. Therefore, the following procedures can only be called simple, and the interface effects and functions are "simple ".

The main key point is to take a random number. the formula (range upper limit-range lower limit + 1) * Math. random () + range lower limit is used to take a random number within the specified range. The source code is as follows:

  Lucky draw applet 
  

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.