kazuhikoarase / qrcode-generator

QR Code Generator implementation in JavaScript, Java and more.
https://kazuhikoarase.github.io/qrcode-generator/js/demo/
MIT License
2.1k stars 677 forks source link

Uncaught code length overflow #55

Open Seek-knowledge opened 6 years ago

Seek-knowledge commented 6 years ago

I have some questions. I want to ask.Thanks.

when i code like this: var typeNumber = 4; var errorCorrectionLevel = 'L'; var qr = qrcode(typeNumber, errorCorrectionLevel); qr.addData('here comes qr!here comes qr!here comes qr!here comes qr!here comes qr!here comes qr!here comes qr!here comes qr!here comes qr!here comes qr!here comes qr!'); qr.make(); document.getElementById('placeHolder').innerHTML = qr.createImgTag();

the Error occurred like this: qrcode.js:352 Uncaught code length overflow. (1244>512)

For some reason, I can't use especially “createElement” .from "sample.js": `var body_loadHander = function() { var crtOpt = function(value, label) { var opt = document.createElement('option'); opt.appendChild(document.createTextNode(label) ); opt.value = value; return opt; };

var t = document.forms['qrForm'].elements['t']; t.appendChild(crtOpt('' + 0, 'Auto Detect') ); for (var i = 1; i <= 40; i += 1) { t.appendChild(crtOpt('' + i, '' + i) ); } t.value = '0'; update_qrcode(); };`

I'm curious about what it's going to do。And especially when I delete that method.

likezero commented 5 years ago

this same on me

juleshwar commented 5 years ago

Well each version(mentioned as typeNumber in the code) of the QR code has a certain data capacity related to it. The text you have provided exceeds the available capacity. Set typeNumber as 0 for auto detection of version based on your input text. Read more about QR code versions here

anuranBarman commented 3 years ago

Well each version(mentioned as typeNumber in the code) of the QR code has a certain data capacity related to it. The text you have provided exceeds the available capacity. Set typeNumber as 0 for auto detection of version based on your input text. Read more about QR code versions here

adding versionNumber as 0 also does not solve the problem. Still getting ERROR code length overflow error

mentalic commented 3 years ago

It needs to be '0', not 0