In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the javascript implementation of QR code how to write the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that after reading this javascript QR code how to write the article will have a harvest, let's take a look.
Javascript to achieve QR code methods: 1, download qrcodejs plug-in; 2, use qrcode to achieve QR code generation, such as "new QRCode (document.getElementById (" qrcode ")".
This article operating environment: windows7 system, javascript1.8.5 version, Dell G3 computer.
How does javascript realize the QR code?
Realization of QR Code Generation by js
We can use qrcodejs to realize js to generate QR code. Qrcodejs is a cross-browser QRCode generator for JavaScript, which can be very simple to generate QR code.
One: download the qrcodejs plug-in
The downloaded qrcode file is as follows, in which qrcode.js and qrcide.min.js are the js,qrcode.min.js we need and the qrcode.js compressed version
Second: realize the generation of QR code
1: js to be introduced
Qrcodejs is designed to be implemented under the premise of jquery, so we need to introduce jquery before introducing qrcodejs.
2: using qrcode to generate QR code
New QRCode (document.getElementById ("qrcode"), "https://wj0511.com");"
At this time, we visit the current page and we can see the QR code we generated. Scan the QR code and visit https://www.wj0511.com.
Here are some of the basic parameters of new QRCode
The QR code generated above can be redirected to the specified url, and we can also set some basic parameters of the QR code, as follows
Var qrcode = new QRCode (document.getElementById ("qrcode"), {text: "content of https://www.wj0511.com",// scanned QR code width: 128 QR code width height: 128 QR code high colorDark:" # 000000 ", / / QR code line color colorLight:" # ffffff ", / / QR code background color correctLevel: QRCode.CorrectLevel.H / / QR code grade}) This is the end of the article on "how to write the code of javascript QR code". Thank you for reading! I believe that everyone has a certain understanding of "how to write the code of javascript QR code". If you want to learn more knowledge, you are welcome to follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.