Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught code length overflow #55

Open
Seek-knowledge opened this issue Jul 17, 2018 · 4 comments
Open

Uncaught code length overflow #55

Seek-knowledge opened this issue Jul 17, 2018 · 4 comments

Comments

@Seek-knowledge
Copy link

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
Copy link

this same on me

@juleshwar
Copy link

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
Copy link

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
Copy link

It needs to be '0', not 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants