最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Uncaught ReferenceError: QRCode is not defined - Stack Overflow

programmeradmin0浏览0评论

I tried to implement a QRCode in my HTML-Template:

 <div id="qrcode">
        <script type="text/javascript">
            new QRCode(document.getElementById('qrcode'), '');
        </script>
    </div>

In my qrcode.min.js I have this:

var qrcode = new QRCode(document.getElementById("qrcode"), {
text: "",
width: 128,
height: 128,
colorDark : "#000000",
colorLight : "#ffffff",
correctLevel : QRCode.CorrectLevel.H
});

But I still get this error and the QRCode don't show off..

Here is my path:

<script "type=text/javascript" src="qrcode.min.js"></script>

Solved

I solved the issue.

The problem was that I integrated :

var qrcode = new QRCode(document.getElementById("qrcode"), {
text: "",  
width: 128,
height: 128,
colorDark : "#000000",
colorLight : "#ffffff",
correctLevel : QRCode.CorrectLevel.H
});

But I never integrated the function "QRCode". .min.js

There is a really good documentation about the implementation of QRCodes. I needed this function in my qrcode.min.js and now it is working.

发布评论

评论列表(0)

  1. 暂无评论