jQuery QRCode Generator

1.0.3 · abandoned · verified Wed Apr 22

jquery.qrcode is a pure browser-side jQuery plugin designed for generating QR codes dynamically within web pages. Released over a decade ago, its last stable version, 1.0.3, was published in 2016. The package does not have a regular release cadence and is no longer actively maintained under its primary npm listing. Its key differentiators include being a standalone solution, generating QR codes without relying on external services, producing compact output (less than 4KB minified and gzipped), and not requiring image downloads. This approach minimizes latency and external dependencies, making it suitable for environments where offline capability or strict control over assets is required. However, its age means it predates modern JavaScript module systems and may have compatibility issues with recent jQuery versions or build tools. Newer, actively maintained QR code libraries and jQuery plugin forks (like lrsjng/jquery-qrcode) are available as alternatives.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to include jQuery and jquery.qrcode via CDN, then generate a QR code for the current page's URL within a specified DOM element upon document ready.

<!-- index.html -->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>jQuery QRCode Quickstart</title>
    <script type="text/javascript" src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
</head>
<body>
    <h1>Scan Me!</h1>
    <div id="qrcode-container"></div>

    <script type="text/javascript">
        $(document).ready(function() {
            const currentUrl = window.location.href;
            $('#qrcode-container').qrcode({
                width: 256,
                height: 256,
                text: currentUrl,
                // Optional: set the color
                // 'color': '#3a3',
                // 'ecLevel': 'H' // Error Correction Level: L, M, Q, H
            });
            console.log('QR Code generated for URL:', currentUrl);
        });
    </script>
</body>
</html>

view raw JSON →