Home  >  Article  >  Web Front-end  >  JavaScript dynamically generates QR code images_javascript skills

JavaScript dynamically generates QR code images_javascript skills

WBOY
WBOYOriginal
2016-05-16 15:04:332035browse

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&#63;token='+token;
qrcode.makeCode(QRCodeUrl); 

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn