qrcodejs README

The project's README from github.com/davidshimjs/qrcodejs. As one markdown file: README.md.

QRCode.js

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.

Basic Usages

<div id="qrcode"></div>
<script type="text/javascript">
new QRCode(document.getElementById("qrcode"), "http://jindo.dev.naver.com/collie");
</script>

or with some options

<div id="qrcode"></div>
<script type="text/javascript">
var qrcode = new QRCode(document.getElementById("qrcode"), {
	text: "http://jindo.dev.naver.com/collie",
	width: 128,
	height: 128,
	colorDark : "#000000",
	colorLight : "#ffffff",
	correctLevel : QRCode.CorrectLevel.H
});
</script>

and you can use some methods

qrcode.clear(); // clear the code.
qrcode.makeCode("http://naver.com"); // make another code.

Browser Compatibility

IE6~10, Chrome, Firefox, Safari, Opera, Mobile Safari, Android, Windows Mobile, ETC.

License

MIT License

Contact

twitter @davidshimjs

Bitdeli Badge

qrcodejs (davidshimjs/qrcodejs)

Searching Database…

14.3K ·GitHub
What is this?QRCode.js is a JavaScript library for generating QR codes directly in the browser, with no backend or image API needed.
Is it a framework or just a small library?It's a small standalone library that renders QR codes using either HTML5 Canvas or an HTML table, whichever the browser supports.
How do I add it to a page?Include the qrcode.js script in your page, then create a 'new QRCode(element, options)' pointing at a DOM element to render the code, optionally with text, size and color options.
Do I need any other libraries or build tools to use it?No, QRCode.js has zero dependencies, so it can be dropped into any page as a plain script.
Will it work in old or mobile browsers?Yes, it explicitly supports a very wide range including IE6 through IE10, Chrome, Firefox, Safari, Opera, Mobile Safari, Android browser and Windows Mobile.
Where does this run — only desktop browsers?It's purely client-side and runs on both desktop and mobile browsers, since it falls back to a table-based rendering when Canvas isn't available.
Does my data get sent anywhere to generate the QR code?No, everything is generated locally in the browser; there's no server call or external API involved.
Can I customize the QR code's size and colors?Yes, the options passed to the QRCode constructor let you set things like width, height, and foreground/background colors beyond just the text to encode.
Why would I use this instead of an online QR generator website?Because it runs fully client-side with no dependencies and no network request, so QR codes can be generated offline, instantly, and without sending data to a third-party service.
Size
0.1 MB
Stars
14.3K
Updated
CommitNov 25
Age
13y
Commits · 90 Days