Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

124
Views
Usar el escáner de código de barras zxing dentro de una página web y escanear múltiples códigos de barras en la misma página

Estoy tratando de usar el siguiente código para escanear varios códigos de barras e insertarlos en los cuadros de texto correspondientes. Lo que quiero lograr es presionar el botón de escaneo frente al campo de texto y el resultado del escaneo se insertará en el campo de texto cerca del botón de escaneo. Ex del código que uso (está bien para el primer campo de texto)

 <!DOCTYPE html> <script type="text/javascript"> function zxinglistener(e){ localStorage["zxingbarcode"] = ""; if(e.url.split("\#")[0] == window.location.href){ window.focus(); processBarcode(decodeURIComponent(e.newValue)); } window.removeEventListener("storage", zxinglistener, false); } if(window.location.hash != ""){ localStorage["zxingbarcode"] = window.location.hash.substr(1); self.close(); window.location.href="about:blank";//In case self.close is disabled }else{ window.addEventListener("hashchange", function(e){ window.removeEventListener("storage", zxinglistener, false); var hash = window.location.hash.substr(1); if (hash != "") { window.location.hash = ""; processBarcode(decodeURIComponent(hash)); } }, false); } function getScan(){ var href = window.location.href.split("\#")[0]; window.addEventListener("storage", zxinglistener, false); zxingWindow = window.open("zxing://scan/?ret=" + encodeURIComponent(href + "#{CODE}"),'_self'); } </script> <html> <head> <script type="text/javascript"> function processBarcode(b){ document.getElementById("result1").value=b; } </script> </head> <body> <button onclick="getScan()">get Scan result1</button> <input id="result1" type="text"></input><br> <button onclick="getScan()">get Scan result2</button> <input id="result2" type="text"></input><br> <button onclick="getScan()">get Scan result3</button> <input id="result3" type="text"></input><br> </body> </html>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!