Plug-in Description: Jquery.qrcode.js is a client-generated matrix QR code qrcode jquery plug-in, using it can easily generate two-dimensional barcode on the page.
How to use it
Add Jquery.qrcode.min.js and jquery to your Web page
<script src="jquery.min.js"></script><script type="text/ JavaScript "src="jquery.qrcode.min.js"></script>
Then create a DOM element to contain the generated QR code.
<div id="qrcode"></div>
And then you add the QRCode in this container
JQuery ('#qrcode'). QRCode ("http://www.jq22.com");
"Advanced usage"
Specify how the two-dimensional code is generated:
You can enter the desired two-dimensional code generation method (Table/canvas) while calling the function. That is, to generate the corresponding QR code under certain conditions.
//using table GenerationJQuery ('#qrcode'). QRCode ({render:"Table", Text:"http://www.jq22.com"}); //using canvas to buildJQuery ('#qrcode'). QRCode ({render:"Canvas", Text:"http://www.jq22.com"});
Specify the size of the generated QR code:
You can specify the size of the generated QR code by typing the width and height of the QR code you want to generate while calling the function.
// generate a two-dimensional code for 100*100 (width 100, height 100) jQuery ('#qrcode'). QRCode ({ render "canvas",// can also be replaced by table width , height , text "http://www.jq22.com "});
Specify the color style to generate the QR code:
You can specify the color style of the generated QR code by typing the foreground and background colors that you want to generate for the QR code while calling the function.
//generate a two-dimensional code with foreground color red background color whiteJQuery ('#qrcode'). QRCode ({render:"Canvas",//can also be replaced by tableForeground"#C00", background:"#FFF", Text:"http://www.jq22.com"});
JS generates two-dimensional code