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

JavaScript dynamically generates QR code images_javascript skills

WBOY
Release: 2016-05-16 15:04:33
Original
2081 people have browsed it

1.html代码

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

2.引入外部js文件

<script src="QRCode.js"></script>
Copy after login

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); 
Copy after login

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

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template