码迷,mamicode.com
首页 > Web开发 > 详细

使用QRCode.js将url生成二维码

时间:2020-05-12 09:58:57      阅读:107      评论:0      收藏:0      [点我收藏+]

标签:static   nbsp   assets   https   http   col   ext   asc   下载   

插件下载地址:

https://static.runoob.com/assets/qrcode/qrcode.min.js

1. 普通用法

<div id="qrcode"></div>
<script type="text/javascript">
new QRCode(document.getElementById("qrcode"), "http://jindo.dev.naver.com/collie");
</script>

2. 自定义样式

<div id="qrcode"></div>
<script type="text/javascript">
var qrcode = new QRCode(document.getElementById("qrcode"), {
    text: "http://jindo.dev.naver.com/collie",
    width: 128,
    height: 128,
    colorDark : "#000000",
    colorLight : "#ffffff",
    correctLevel : QRCode.CorrectLevel.H
});
</script>

 

使用QRCode.js将url生成二维码

标签:static   nbsp   assets   https   http   col   ext   asc   下载   

原文地址:https://www.cnblogs.com/glmkeep/p/12874154.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!