JavaScript动态生成二维码图片

  作者:bea

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.getEleme
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);

以上内容是小编给大家介绍的JavaScript动态生成二维码图片的相关内容,希望对大家有所帮助!


有用  |  无用

猜你喜欢