JavaScript generates a two-dimensional code sample with parameters _javascript tips

Source: Internet
Author: User

Objective

In the recent project has a requirement is to generate a two-dimensional code with parameters, consider the use of Java background generation back to the front-end display, after the Qrcode.js plug-in with jquery can be very good reality, the following words do not say, directly on the implementation of the process.

Introduce JS:

Require.config ({  baseurl: "/",  paths: {jquery: ' Plugin/jquery/jquery-3.1.0.min ', QRCode: ' plugin/qrcode/ QRCode '  }}); Require (  [' jquery ', ' QRCode '  ],   function ($) {xxxx.  })

Dom to render:

<div id= "Qrcodecanvas" ></div>

Initialize two-dimensional code:

 

It is noteworthy that "text" if it is linked and need to automatically jump, just take the http://start

Effect Chart:

Well, the above is the use of JavaScript to generate a two-dimensional code with parameters of the entire content, I hope this article on the content of our study or work can bring some help, if you have questions you can message exchange.

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.