반응형
Notice
Recent Posts
Recent Comments
Link
«   2023/09   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
Archives
Today
Total
관리 메뉴

둘에서 하나로....

자바스크립트로 바코드스캐너 연결하기 본문

프로그래밍

자바스크립트로 바코드스캐너 연결하기

서기㏇ 2019. 5. 15. 11:39
반응형

scan.js
0.01MB

jquery를 사용시 아래와 같이 하면 바코드 스캐너로 입력하는 값을 처리할 수 있습니다. 

 

 

   $(document).scannerDetection({ 
        timeBeforeScanTest: 200, // wait for the next character for upto 200ms 
        startChar: [120], // Prefix character for the cabled scanner (OPL6845R) 
        endChar: [13], // be sure the scan is complete if key 13 (enter) is detected 
        avgTimeByChar: 40, // it's not a barcode if a character takes longer than 40ms 
        onComplete: function(barcode, qty){

            alert(barcode); // 바코드 출력 

        }
  }); 
반응형
Comments