JavaScript How can you to interpret a forward slash in a QR code so that the entire string is read using JavaScript?

I am developing a web page in which a user can use a barcode scanner to scan a QR code.

I am using the following code to capture the contents of the QR code:

$(document).ready(function () {
    var barcode = "";

    $(document).keydown(function (e) { 
        var code = (e.keyCode ? e.keyCode : e.which);

        barcode = barcode + String.fromCharCode(code);
    });
});

There is a forward slash (/) in the QR code that is getting converted to an upside down question mark (¿) and the rest of the code is ignored.

Here is the expected result:

1111P111FP301X 453530137791 05016/201506 182

And this is the actual result:

1111P111FP301Xm453530137791m05016/

What can I do so that the whole string is read?

Answer:1

I would like to ask a question about event handlers when used in HTML and React. In the book Javascript and Jquery written by Jon Duckett, the author mentioned that using HTML event handler attribute ...

I would like to ask a question about event handlers when used in HTML and React. In the book Javascript and Jquery written by Jon Duckett, the author mentioned that using HTML event handler attribute ...

  1. html event handler attributes
  2. html event handler javascript
  3. html event handler
  4. html event handler return value
  5. html event handler parameters
  6. html event handler list
  7. html event handler arguments
  8. html event handler xss
  9. html event handler dropdown
  10. html event handler input
  11. html event handler remove
  12. html click event handler
  13. html inline event handler
  14. html button event handler
  15. html checkbox event handler
  16. html select event handler
  17. html add event handler
  18. html onclick event handler
  19. html form event handler
  20. html submit event handler

Hello im trying to use Math.min but i am getting NaN as a result, this is the code. method using Math.min method() { var DeltaPrueba = this._markerService.getDeltasRx1(); console.log(DeltaPrueba); ...

Hello im trying to use Math.min but i am getting NaN as a result, this is the code. method using Math.min method() { var DeltaPrueba = this._markerService.getDeltasRx1(); console.log(DeltaPrueba); ...

I have two types of Strings like the following : 78:24207 PERF keytouchListAction ProtocolSelect 04.00 : 1502876877199 1502876879180 or 78:27247 PERF create tab state : 1502876879180 I'm looking ...

I have two types of Strings like the following : 78:24207 PERF keytouchListAction ProtocolSelect 04.00 : 1502876877199 1502876879180 or 78:27247 PERF create tab state : 1502876879180 I'm looking ...

Unfortunately I did not find any existing solution for my problem on stackoverflow. So, can someone help. I want to get the text of an html-element. I tried this: var element = driver.findElement(...

Unfortunately I did not find any existing solution for my problem on stackoverflow. So, can someone help. I want to get the text of an html-element. I tried this: var element = driver.findElement(...

  1. text html element
  2. text html element center
  3. html text element with id
  4. html text element color
  5. html text element attributes
  6. html text element width
  7. html text element value
  8. html text element line break
  9. html text element properties
  10. html text element tag
  11. html text element new line
  12. html text element dom
  13. html text element border
  14. html text element bold
  15. html text element font
  16. html text element input
  17. html text element code
  18. text element html div
  19. get text html element javascript
  20. set text html element