html介绍

AJAX

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=<device-width>, initial-scale=1.0" />
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
</head>

<body>
    <script>
        $(function() {
            $.ajax({
                type: "POST",
                contentType: "application/json;charset=UTF-8",
                url: "http://127.0.0.1/admin/list/",
                data: JSON.stringify(list),
                success: function(result) {
                    console.log(result);
                },
                error: function(e) {
                    console.log(e.status);
                    console.log(e.responseText);
                },
            });
        });
    </script>
</body>

</html>

倒计时

定时执行

var myVar;
myVar = setTimeout(function () {
    alert("Hello");
}, 3000);
clearTimeout(myVar);

反复执行

var myVar;
function myFunction() {
    myVar = setInterval(alertFunc, 3000);
}
function alertFunc() {
    alert("Hello!");
}

编码

https://encoding.spec.whatwg.org/#gbk-decoder

js中 urlencode编码 encodeURIComponent(编码的具体内容)解码 decodeURIComponent(解码码的具体内容)