简体   繁体   English

如何使用html5 jquery或javasctipt创建用于移动设备扫描条形码的按钮?

[英]How to create button for mobile to scan Barcode using html5 jquery or javasctipt?

Is there any way to trigger mobile phone camera to scan Barcode from html using jquery or javascript ? 有什么方法可以触发手机摄像头使用jquery或javascript从html扫描条形码? I would like to create form and then button (when you clicked on mobile it will let you scan code and it will place the code on input field) Is that possible? 我想创建一个表单,然后创建一个按钮(当您单击移动设备时,它将允许您扫描代码,并将代码放置在输入字段中)可以吗?

You might want to look at: https://serratus.github.io/quaggaJS/ 您可能要看一下: https : //serratus.github.io/quaggaJS/

I haven't used it in any production code yet but have experimented with it. 我尚未在任何生产代码中使用过它,但已经对其进行了试验。 Scanning good quality barcodes works well. 扫描高质量的条形码效果很好。 Scanning through plastic bags and shrink wrap is a bit iffy. 扫描通过塑料袋和收缩包装有点困难。 (To be fair, dedicated scanners also have issues there, but tend to do better.) (为公平起见,专用扫描仪在那里也有问题,但往往做得更好。)

Tested only on Android with Chrome and Firefox. 仅在装有Chrome和Firefox的Android上进行过测试。 Requires the most recent iOS/Safari to work on that platform. 需要最新的iOS / Safari才能在该平台上运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM