js动态生成二维码图片

1.html代码

<div id="qrcode" style="width:200px; height:200px;position: fixed;bottom: 40%; right: 20%;"></div>

2.引入外部js文件

<script src="QRCode.js"></script>

3.方法调用

var qrcode = new QRCode(document.getElementById("qrcode"), {
                    width : 200,
                    height : 200
                }); 
                var token='params';
                var QRCodeUrl='http:\\www.baidu.com'+'/Share/ScanQRCode?token='+token;
                qrcode.makeCode(QRCodeUrl); 

4.QRCode.js文件

 下载地址:https://files.cnblogs.com/files/weishuanbao/QRCode.js

posted on 2016-04-20 11:31  CeleryCabbage  阅读(703)  评论(0编辑  收藏  举报

导航