我通过以下方式使用jquery.scannerdetection.js,当我使用扫描仪时,一切正常,但是在文本输入字段上,键盘不再起作用,因为调用了onError方法。你能告诉我我做错了什么吗? 谢谢
$(document).ready(function() {
$(document).scannerDetection({
timeBeforeScanTest: 200,
avgTimeByChar: 40,
preventDefault: true,
endChar: [13],
onComplete: function(barcode, qty){
if(barcode.substring(0,5) == "DTORD") {
var datiOrdineMagazzino = new DettaglioOrdineMagazzino(barcode.substring(5), function() {
caricaMonitor();
});
datiOrdineMagazzino.show();
}
},
onError: function(string, qty) {
var el = document.activeElement;
el.value = string;
}
});
$(document).bind('scannerDetectionComplete');