Comments (8)
Ok, problem is the qrcode.min.js
file.
It works fine on qrcode.js
Tested on Chrome, Safari, Firefox, and had no problem so far. Below is the code of the Testpage i used (just edited index.html
with your JS code).
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko">
<head>
<title>Cross-Browser QRCode generator for Javascript</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" />
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript" src="qrcode.js"></script>
</head>
<body>
<div id="qrcode" style="width:100px; height:100px; margin-top:15px;"></div>
<script type="text/javascript">
var QRCodeBox = new QRCode(document.getElementById("qrcode"), {
width: 200,
height: 200,
correctLevel: QRCode.CorrectLevel.H
});
var str = "ed2k://|file|【电影家园www.idyjy.com下载】寂静之地.HD韩版中英双字.mp4|1129787457|AD3BD4384712D52D2BB09A150AF64D55|h=BMZZS7VBJ4ZAROGOU56245LCBBO6DRO7|/";
QRCodeBox.makeCode(str);
</script>
</body>
Will redo a min.js as soon as i have a bit of time for this.
Thanks for the bug submission.
In the mean time, i highly recommend you to use the non-minified version, or to minify it yourself...
I'm not sure i'll have time today to do this. ;-)
Have a good day !
from qrcodejs.
nice job dude
from qrcodejs.
Hello @suxiaogang.
I need more information about your problem. What is the length (eventually content if not private) of the QR Code you're trying to generate ?
Did you try any other correctLevel parameter ?
from qrcodejs.
emmmmm.... after investigation this might be related to character encoding ...
actually I'm try to qrcode some string which contains Chinese
var QRCodeBox = new QRCode(document.getElementById("qr"), {
width: 200,
height: 200,
correctLevel: QRCode.CorrectLevel.H
});
var str = "ed2k://|file|【电影家园www.idyjy.com下载】寂静之地.HD韩版中英双字.mp4|1129787457|AD3BD4384712D52D2BB09A150AF64D55|h=BMZZS7VBJ4ZAROGOU56245LCBBO6DRO7|/";
QRCodeBox.makeCode(str);
@fladna9 well you can close this issue if it is confirmed to be a encoding problem.
from qrcodejs.
Strange. Got this on Chrome Version 66.0.3359.181 (Official build) (64 bits) on macOS, no warnings/errors in JS console...
Will try in Firefox and Safari.
from qrcodejs.
Chrome/65.0.3325.181 & Mac OS X 10_13_4, everytime
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body class="chrome-popup">
<div style="width:100%;margin:35px;" id="qr"></div>
<script src="http://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
<!--replace below with your forked file-->
<script src="https://raw.githubusercontent.com/KeeeX/qrcodejs/master/qrcode.min.js"></script>
</body>
<script>
$(document).ready(function() {
var QRCodeBox = new QRCode(document.getElementById("qr"), {
width: 200,
height: 200,
correctLevel: QRCode.CorrectLevel.H
});
var str = "ed2k://|file|【电影家园www.idyjy.com下载】寂静之地.HD韩版中英双字.mp4|1129787457|AD3BD4384712D52D2BB09A150AF64D55|h=BMZZS7VBJ4ZAROGOU56245LCBBO6DRO7|/";
QRCodeBox.makeCode(str);
});
</script>
</html>
qrcode.min.js:1 Uncaught Error: code length overflow. (3004>1440)
at Function.b.createData (qrcode.min.js:1)
at b.makeImpl (qrcode.min.js:1)
at b.getBestMaskPattern (qrcode.min.js:1)
at b.make (qrcode.min.js:1)
at QRCode.makeCode (qrcode.min.js:1)
at HTMLDocument.<anonymous> (test.html:22)
at i (jquery.min.js:2)
at Object.fireWith [as resolveWith] (jquery.min.js:2)
at Function.ready (jquery.min.js:2)
at HTMLDocument.K (jquery.min.js:2)
from qrcodejs.
I will leave this Open until a fixed qrcode.min.js
will be uploaded.
from qrcodejs.
Fixed in df9405a, closing issue.
from qrcodejs.
Related Issues (4)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qrcodejs.