Skip to content

Instantly share code, notes, and snippets.

@Jorgelig
Created August 12, 2013 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jorgelig/6212842 to your computer and use it in GitHub Desktop.
Save Jorgelig/6212842 to your computer and use it in GitHub Desktop.
A CodePen by Sangmin, Shim. Cross-browser QRCode - QRCode.js is javascript library for making QRCode. QRCode.js supports Cross-browser with HTML5 Canvas and table tag in DOM. QRCode.js has no dependencies. Check it out http://davidshimjs.github.com/qrcodejs/
<input id="text" type="text" value="http://jindo.dev.naver.com/collie" style="width:80%" /><br />
<div id="qrcode"></div>
var qrcode = new QRCode("qrcode");
function makeCode () {
var elText = document.getElementById("text");
if (!elText.value) {
alert("Input a text");
elText.focus();
return;
}
qrcode.makeCode(elText.value);
}
makeCode();
$("#text").
on("blur", function () {
makeCode();
}).
on("keydown", function (e) {
if (e.keyCode == 13) {
makeCode();
}
});
#qrcode {
} width:160px;
height:160px;
margin-top:15px;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment