How to generate a QR code using jQuery qrcode and jqueryqrcode

Source: Internet
Author: User

How to generate a QR code using jQuery qrcode and jqueryqrcode

Today, QR codes are becoming more and more popular. Many web pages have a QR code, which can be viewed by mobile phones after scanning.

In the past, similar projects were generally used to generate images on webpages and insert images to webpages.

In this way, the QR Code cannot be generated on every page.

Jquery-qrcode is a jquery plug-in that can generate QR code on the browser side. It is independent, with a minimum compression capacity of less than 4 kb and no image download requests. After this class library is introduced, you only need a line of code to easily add a QR code to the web page.

Qrcode implements graphic rendering and drawing by using jQuery. It supports canvas (HTML5) and table.

Https://github.com/jeromeetienne/jquery-qrcode

Obtain the latest code.

How to Use

1. First, add the jquery library file and qrcode plug-in to the page.

<script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="jquery.qrcode.min.js"></script>

2. Add the following code to the page where you need to display the QR code:

<div id="code"></div>

3. Call the qrcode plug-in

Qrcode supports canvas and table for Image Rendering. By default, the canvas mode is used, with the highest efficiency. Of course, the browser must support html5.

Direct call:

$ ('# Code'). qrcode ("http://www.bkjia.com.com"); // any string

Advanced attributes:

$ ("# Code "). qrcode ({render: "table", // table mode width: 200, // width height: 200, // height text: "www.helloweba.com" // any content });
Articles you may be interested in:
  • Use jquery. qrcode. min. js to implement Chinese conversion QR code
  • Use the jquery plug-in qrcode to generate a QR code
  • Jquery plug-in qrcode online QR code generation
  • Use the jquery component qrcode to generate QR code and Application Guide
  • Use jquery. qrcode to generate a color QR code instance
  • Use jquery. qrcode to generate a QR code on the page and support Chinese Characters
  • Use jquery. qrcode to generate a QR code online

Related Article

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.