Home  >  Article  >  Web Front-end  >  QRCode.js JS library instance method for generating QR code based on JQuery

QRCode.js JS library instance method for generating QR code based on JQuery

小云云
小云云Original
2018-01-06 10:50:512304browse

This article mainly introduces QRCode.js: the use of JS library for generating QR codes based on JQuery. It has certain reference value. Interested students can learn about it and hope it can help everyone.

1. QRCode.js

QRCode.js is a QR code generation javascript library; supports cross-browser HTML5 Canvas and table tag DOM operations; and does not rely on other library or extension.

Homepage: QRCode.js

Github: davidshimjs/qrcodejs

2. Usage

2.1 Basic usage

2.2 Usage of passing parameters

2.3 Calling function

qrcode.clear(); // 清除二维码
qrcode.makeCode("//m.sbmmt.com"); // 创建一个新的二维码

3. Scope of application

I used PHP QR Code to generate QR code before, and found that through this PHP plug-in To generate, there are some minor problems; its internal integration is not very good, it is not very suitable for displaying QR codes directly on the browser, and the style is difficult to control (without saving the QR code file).

The use of QRCode.js can control the style very much, just like a picture, because the picture is directly output to

, which is very controllable. Just like the previous WeChat payment official sdk, phpsdk was generated using phpqrcode and changed to QRCode.js. After that, a simple effect:

Related recommendations:

HTML5 implements the function of sharing QR codes on major WeChat QQ and other communication platforms

HTML5 hybrid development QR code scanning and calling local camera example tutorial

How to implement QR code recognition in PHP - example sharing

The above is the detailed content of QRCode.js JS library instance method for generating QR code based on JQuery. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn