yyqc2017

        参考网址:http://code.ciaoca.com/javascript/qrcode/

1、下载qrcode.js插件

  

2、导入插件:

  

3、js路径:

  

4、方法:

<script type="text/javascript">

//二维码方法

function code(){

    New QRCode(document.getElementById(\'qrcode\'), \'1234567a23\');

             // 设置参数方式

            var qrcode = new QRCode(\'qrcode\', {

                      width: 156,

                      height: 0,

                      colorDark : \'#000000\',

                      colorLight : \'#ffffff\',

                      correctLevel : QRCode.CorrectLevel.H

             });

    qrcode.clear();

    qrcode.makeCode(\'1234567a23\');

}

</script>

 

5、

<body>

 <div id="qrcode">

   <input type="button" onclick="code();" value="点我">

</div> 

</body>

 

  

 

分类:

技术点:

相关文章:

  • 2021-10-06
  • 2021-12-14
  • 2021-11-21
  • 2021-12-03
  • 2021-04-21
  • 2021-08-12
  • 2022-02-23
  • 2022-12-23
猜你喜欢
  • 2022-01-15
  • 2022-01-16
  • 2021-10-01
  • 2021-12-10
  • 2022-12-23
  • 2021-12-18
  • 2022-12-23
相关资源
相似解决方案