html5-qrcode icon indicating copy to clipboard operation
html5-qrcode copied to clipboard

Someone has a basic example code?

Open alexchvrches opened this issue 7 years ago • 3 comments

I'm new at the library and I don't know how it works, I tried with this code, but I can't make it works :(

<!DOCTYPE html>
<html lang="es">
  <head>
    <title>Lector de códigos</title>
    <script type="text/javascript" src="html5-qrcode.min.js"></script>
  </head>
  <body>
    <div id="reader" style="width:300px;height:250px">
    </div>
      <script type="text/javascript">
      $('#reader').html5_qrcode(function(data){
     // do something when code is read
        },
        function(error){
          //show read errors 
        }, function(videoError){
          //the video stream could be opened
        }
      );
    </script>
  </body>
</html>

Can someone help me, please?

alexchvrches avatar Nov 25 '17 05:11 alexchvrches

try this : delete "type='text/javascript' " in the first

foxstudiohua avatar Dec 13 '17 01:12 foxstudiohua

@alexchvrches you need to add this:

 <head>
    <title>Lector de códigos</title>
   <script type="text/javascript" src="https://raw.githubusercontent.com/dwa012/html5-qrcode/master/lib/jsqrcode-combined.min.js"></script>
    <script type="text/javascript" src="html5-qrcode.min.js"></script>
  </head>

or download the script

jat10 avatar Mar 13 '18 14:03 jat10

请问成功了吗?我这边没成功

Document

guaicaiboshi avatar Mar 25 '19 08:03 guaicaiboshi