In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-10 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
Most people do not understand the knowledge points of this article "javascript how to achieve QR code", so the editor summarizes the following content, detailed content, clear steps, and has a certain reference value. I hope you can get something after reading this article. Let's take a look at this "how to achieve QR code in javascript" article.
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}) The above is about the content of this article on "how to realize the QR code in javascript". I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant knowledge, please 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: 214
*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.