xm666

我遇到的是列表页,每个列表都有一个微信分享按钮,所以网站的url值一定要找到当前值,才是正确的,

$(".wx").click(function(){ //找到分享按钮,然后点击
        var zhi = $(this).next(\'.source\').val(); 找到按钮点击当前的 input 值;这个很重要,切记!
        // $(this).parent().parent()
        // alert(zhi);
        $(\'#qrcode\').empty();//保证生成二维码的div为空,因为我们还要点击其他的列表,不清空就会重复显示
        var qrcode = new QRCode(document.getElementById("qrcode"), {  //定义生成二维码的div
            width : 100,
            height : 100
        });
        
        function makeCode () {  //创建二维码的函数
            qrcode.makeCode(zhi);
            console.log(qrcode.makeCode(zhi));
        }
        makeCode();  //调用此二维码     
        $(".bsBox").show(); //显示另一个div
    })



cdn:<script type="text/javascript" src="//static.runoob.com/assets/qrcode/qrcode.min.js"></script>

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-18
  • 2021-08-31
  • 2021-10-30
  • 2021-10-18
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2022-02-11
  • 2022-01-23
相关资源
相似解决方案