惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Vulnerabilities – Threatpost
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
云风的 BLOG
云风的 BLOG
N
Netflix TechBlog - Medium
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Security Archives - TechRepublic
Security Archives - TechRepublic
P
Privacy International News Feed
F
Full Disclosure
P
Proofpoint News Feed
The Hacker News
The Hacker News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
The Blog of Author Tim Ferriss
T
Threatpost
L
Lohrmann on Cybersecurity
I
Intezer
S
SegmentFault 最新的问题
小众软件
小众软件
T
Threat Research - Cisco Blogs
MongoDB | Blog
MongoDB | Blog
美团技术团队
NISL@THU
NISL@THU
罗磊的独立博客
N
News | PayPal Newsroom
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
博客园 - 聂微东
W
WeLiveSecurity
Microsoft Security Blog
Microsoft Security Blog
阮一峰的网络日志
阮一峰的网络日志
Scott Helme
Scott Helme
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
TaoSecurity Blog
TaoSecurity Blog
A
Arctic Wolf
P
Privacy & Cybersecurity Law Blog
Attack and Defense Labs
Attack and Defense Labs
I
InfoQ
Microsoft Azure Blog
Microsoft Azure Blog
S
Securelist
D
Darknet – Hacking Tools, Hacker News & Cyber Security
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Schneier on Security
Schneier on Security
Know Your Adversary
Know Your Adversary
人人都是产品经理
人人都是产品经理
The Register - Security
The Register - Security
U
Unit 42
The Cloudflare Blog
T
Tenable Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Recent Announcements
Recent Announcements
D
DataBreaches.Net
量子位

Html - 标签 - cywhat's blog

Jenkins端口修改之后没有生效 Jenkins添加html报告并发送到邮箱 Django发送邮箱验证码实现以及邮箱html模板
html简单实现button加载中且置灰不可点击
cywhat · 2021-09-09 · via Html - 标签 - cywhat's blog

简单js几行代码实现点击按钮,实现加载中,且置灰不可点击

1.html部分

1
2
3
4

<button id="Submit" type="button"
        class="btn btn-rounded btn-primary mb-6" value="获取验证码">
</button>

2.JS部分

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
function ClickBtnSms() {
    $('#Submit').click(function () {
        //按钮校验,disable = true不可点击 val里面的内容替换成你想实现的加载中/loading...等
        $('#Submit').val('加载中...').prop('disabled', true);
        $.ajax({
            url: "url", 
            type: "GET",
            data: {data: data},
            dataType: "JSON", // 将服务端返回的数据反序列化为字典
            success: function (res) {
                if (res.status) {
                    //这里放拿到res状态想要执行的函数
                } else {
                    //如果报错,需要恢复获取验证码的按钮
                    $('#Submit').val('获取验证码').prop('disabled', false);
                }
            }
        })
    })
}

关注一下再走吧

公众号 小程序

赞赏支持

微信打赏 支付宝打赏