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動態生成二維碼圖片的相關內容,希望對大家有所幫助!
新聞熱點
疑難解答