弘帝企业智能建站系统交流平台

 找回密码
 立即注册
查看: 682|回复: 0

JS二维码生成代码

[复制链接]
发表于 2022-7-11 08:56:31 | 显示全部楼层 |阅读模式
DIV:
<section id="code">
<a act="radom"></a><a act="clear"></a>
</section>
JS:
$("section#code").on("click", "[act=radom],[act=clear]", function () {
        var qrcode;
        if ($(this).attr("act") === "clear") {
                HD_Form.qrcode.value = "";
                $("#divqrcode").html('');
        } else {
                HD_Form.qrcode.value = new Date().valueOf();
                $.getScript("/SysThemes/js/qrcode.min.js", function () {
                        $("#divqrcode").html('');
                        qrcode = new QRCode(document.getElementById("divqrcode"), {
                                width: 100,
                                height: 100
                        });
                        var qrvalue = HD_Form.qrcode.value;
                        if (qrvalue === "") {
                                return;
                        } else {
                                qrcode.makeCode(qrvalue);
                        }
                })
        }
});
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|弘帝企业智能建站系统 ( 皖ICP备07503252号 )

GMT+8, 2024-4-26 08:35 , Processed in 0.101885 second(s), 15 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表