HTML implements Double 11 coupon grabbing (set time to open the coupon grabbing page)

HTML implements Double 11 coupon grabbing (set time to open the coupon grabbing page)

Without further ado, I will post the code for you directly. The specific code is as follows:

<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8" />
    <title></title>
    <style type="text/css">
        #result{
            width:500px;
            border:1px solid #CCCCCC;
            background:#FFFFCC;
            margin:50px auto;
            font-size:24px;
            color:#FF0000;
            padding:20px;
        }
    </style>
    <script type="text/javascript">
        window.onload = function () {
            showTime();
            var start = document.getElementById("start");
            start.onclick = function () {
                var path = document.getElementById("path").value;
                var time1 = document.getElementById("time1").value;
                var time2 = document.getElementById("time2").value;
                var time3 = document.getElementById("time3").value;
                start.value = "Waiting to open the order grabbing page";             
                setInterval(function () {
                    var date = new Date();
                     var hour = date.getHours();
                     var minute = date.getMinutes();
                     var second = date.getSeconds();
                    if (hour == time1 && minute == time2 && second == time3) {
                        window.open(path);
                    }
                }, 100);
            };       
        }
        function showTime()
        {
             //Create Date object var today = new Date();
             //Get the year, month, day, hour, minute and second respectively var year = today.getFullYear();
             var month = today.getMonth()+1;
             var day = today.getDate();
             var hours = today.getHours();
             var minutes = today.getMinutes();
             var seconds = today.getSeconds();
             //If it is a single number, add 0 in front
             month = month<10 ? "0"+month : month;
             day = day <10 ? "0"+day : day;
             hours = hours<10 ? "0"+hours : hours;
             minutes = minutes<10 ? "0"+minutes : minutes;
             seconds = seconds<10 ? "0"+seconds : seconds;
             //Build the string to be output var str = year+"年"+month+"月"+day+"日"+hours+":"+minutes+":"+seconds;             
             //Get the object with id=result var obj = document.getElementById("result");
             //Write the contents of str into the <div> with id=result obj.innerHTML = str;
             //Delay window.setTimeout("showTime()",1000);
        }
    </script>
</head>
<body>
    <div>
        <h2>1. Synchronize computer time with Beijing time</h2>
        <h2>2. Set the path address to the address and time of the coupon you want to grab</h2>
        <!--<h3>Coupon Address</h3><input type="text" id=path />-->
        <h3>Coupon address (be careful not to miss http:// or https://)</h3> <!--<textarea id="path" style="width:200px;height:80px;"></textarea>-->
        <input type="url" id="path" style="width:auto"/>
        <h3>Ticket grabbing time</h3>
        <input type="text" id=time1 />Hours<input type="text" id=time2 />Minutes<input type="text" id=time3 />Seconds<h2>3, click to wait, then click to grab the coupon</h2>
        <input type="button" id="start" value="Start"/><div id="result"></div>
    </div>
</body>
</html>

Summarize

The above is the HTML implementation of Double 11 coupon grabbing (setting the time to open the coupon grabbing page) introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

<<:  Implementation of CSS Fantastic Border Animation Effect

>>:  MySQL database aggregate query and union query operations

Recommend

MySQL database green version installation tutorial to solve system error 1067

What is the difference between the green version ...

A brief discussion on the role of HTML empty links

Empty link: That is, there is no link with a targ...

Detailed explanation of log processing of Docker containers

Docker has many log plug-ins. The default is to u...

MySql Group By implements grouping of multiple fields

In daily development tasks, we often use MYSQL...

A detailed introduction to for/of, for/in in JavaScript

Table of contents In JavaScript , there are sever...

How to create a basic image of the Python runtime environment using Docker

1. Preparation 1.1 Download the Python installati...

Analysis of the implementation of MySQL statement locking

Abstract: Analysis of two MySQL SQL statement loc...

How to view the docker run startup parameter command (recommended)

Use runlike to view the docker run startup parame...

Summary of common sql statements in Mysql

1. mysql export file: SELECT `pe2e_user_to_compan...

MySQL 8.0.18 installation and configuration method graphic tutorial under MacOS

This article records the installation of MySQL 8....

Summary of new usage of vi (vim) under Linux

I have used the vi editor for several years, but ...

The latest MySQL 5.7.23 installation and configuration graphic tutorial

The detailed installation and configuration of th...

Using radial gradient in CSS to achieve card effect

A few days ago, a colleague received a points mal...

A practical record of troubleshooting a surge in Redis connections in Docker

On Saturday, the redis server on the production s...

MySQL 8.0 Window Function Introduction and Summary

Preface Before MySQL 8.0, it was quite painful to...