乾太 ₍₍ ◝(・◡・)◟ ⁾⁾ says to YSITD
$('#f2').text(data[1]); $('#f3').text(data[2]); $('#f4').text(data[3]); $('#f5').text(data[4]); $('#f6').text(data[5]); $('#f7').text(data[6]); $('#f8').text(data[7]); $('#f9').text(data[8]); $('#f10').text(data[9]); $('#f11').text(data[10]); if (data[11] === 'Y') { $('#f12').attr('checked', 1); } else { $('#f12').removeAttr('checked'); } } function query() { id = parseInt($('#id').val()); if (!id) return; google.script.run.withSuccessHandler(query_callback).query(id); } Quagga.init({ inputStream: { name: "Live", type: "LiveStream", target: document.querySelector('#camera') }, decoder: { readers: ["code_128_reader"] } }, function (err) { if (err) { console.log(err); return } console.log("Initialization finished. Ready to start"); Quagga.start(); }); lastResult = null; Quagga.onDetected(function (result) { var code = result.codeResult.code; console.log('detected') if (lastResult !== code) { lastResult = code; $('#id').val(code); query(); } }); $('#qry_btn').click(function (e) { query(); e.preventDefault(); }) </script> </body> </html>