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
4.7k stars 935 forks source link

scanner not showing up #524

Open mrtineu opened 1 year ago

mrtineu commented 1 year 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 1 year ago

flask and python and repit

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