Jquery.qrcode.min.js generate two-dimensional code

Source: Internet
Author: User

Jquery.qrcode.min.js is a plug-in that generates two-dimensional code, with the premise that jquery is the first to be used, because Jquery.qrcode.min.js relies on jquery.

Basic usage

1. Introduction of JS

    <script src= "Js/jquery-3.1.1.min.js" ></script>    <script src= "Js/jquery.qrcode.min.js" ></ Script>

2. Building a container

<div class= "App" ></div>

3. Generate two-dimensional code

    $ (". App"). QRCode ({        render: "Canvas",        width:400,        height:400,        text: "http://www.cnblogs.com/ jiangcheng-langzi/"    });

In this way, a two-dimensional code is generated, by sweeping the QR code, you can easily access this blog.

Expand the explanation

(1) QRCode There are two ways to generate QR codes: Table and Canvas.

Table mode: Will generate a lot of code, black and White is a TD, a total of 37 x-Square, the general choice is to be compatible with browsers that do not support canvas

Canvas mode: generated QR code actually using canvas drawing, can be saved as picture format

(2) QRCode default width height is 256px

(3) QRCode uses charCodeAt () for encoding conversion, and this method obtains its Unicode encoding by default, so if text contains Chinese, you need to use theencodeURI()转码。

(4) In addition, the foreground and background colors of the QR code can be specified by attributes foreground and background

Jquery.qrcode.min.js generate a QR code

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.