Use jquery. qrcode to generate a color QR code instance and a jquery. qrcode instance.
Jquery. qrcode. js is a plug-in used to draw two-dimensional codes in the jquery class library. It is used to render two dimensional codes: canvas and table. (When jquery. qrcode. js sets the display mode to table, it will be deformed in the core webkit browser, such as chrome. note this .)
The following is the test code (color control is added. You can set the color values of four blocks. You must specify render as table .), The effect is as follows:
The Code is as follows:
<Html>
Jquery-qrcode this library is using charCodeAt this method for encoding conversion, and this method will get its Unicode encoding by default, the general decoder is using UTF-8, ISO-8859-1 and other methods, english is no problem, if it is Chinese, under normal circumstances Unicode is UTF-16 implementation, length 2 bits, and UTF-8 encoding is 3 bits, so the codec of the QR code does not match.
Solution: Convert the string into a UTF-8 before the QR code, the specific code as above utf16to8 Function
Which QR code generator is used for this QR code?
I will scan for a piece of software, whether you want to provide functions or be beautiful, and I will do this for you for free.
Jqueryqrcodeminjs is used to generate a QR code. A js error occurs when a LAN ip address is used for access. The object does not support the getcontext () method or attribute.
The security mechanism of the browser prevents scripts from running locally.