Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Someone has a basic example code? #66

Open
alexchvrches opened this issue Nov 25, 2017 · 3 comments
Open

Someone has a basic example code? #66

alexchvrches opened this issue Nov 25, 2017 · 3 comments

Comments

@alexchvrches
Copy link

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?

@foxstudiohua
Copy link

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

@jat10
Copy link

jat10 commented Mar 13, 2018

@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

@guaicaiboshi
Copy link

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

<title>Document</title> <script src="./lib/jquery-1.8.3.min.js"></script> <script src="./lib/jsqrcode-combined.min.js"></script> <script src="./src/html5-qrcode.js"></script>
<script> $('#reader').html5_qrcode(function (data) { // do something when code is read alert(data); }, function (error) { //show read errors }, function (videoError) { //the video stream could be opened } ); </script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants