mebjas / html5-qrcode

A cross platform HTML5 QR code reader. See end to end implementation at: https://scanapp.org
https://qrcode.minhazav.dev
Apache License 2.0
5.06k stars 976 forks source link

scanner not showing up #524

Open mrtineu opened 2 years ago

mrtineu commented 2 years ago

so im tryin to use scanner but when i open website it is in ispect but it doesnt work and the div is like 862x0 this is my html code

<html>
<head>
    <title>Html-Qrcode Demo</title>
<body>
    <div id="qr-reader" style="width:500px"></div>
    <div id="qr-reader-results"></div>
</body>
<script src="{{url_for('static', filename='html5-qrcode.min.js')}}">var resultContainer = document.getElementById('qr-reader-results');
var lastResult, countResults = 0;

function onScanSuccess(decodedText, decodedResult) {
    if (decodedText !== lastResult) {
        ++countResults;
        lastResult = decodedText;
        // Handle on success condition with the decoded message.
        console.log(`Scan result ${decodedText}`, decodedResult);
    }
}

var html5QrcodeScanner = new Html5QrcodeScanner(
    "qr-reader", { fps: 10, qrbox: 250 });
html5QrcodeScanner.render(onScanSuccess);</script>
</head>
</html>

btw i use flask and python and repit THanks

ROBERT-MCDOWELL commented 2 years ago

flask and python and repit

??? html5-qrcode is a javascript client side, not server!