<!DOCTYPE html> <html> <head> <meta content="text/html;charset=utf-8" http-equiv="Content-Type" /> <script type="text/javascript" src="jquery.min.js"> </script> <script src="qrcode.min.js"> </script> </head> <body> <div id="qrcode_1"><!--二维码将会生成在这个ID里面--></div> <script> (function(){ new QRCode(document.getElementById('qrcode_1'), 'https://www.baidu.com/'); //需要生成的网址放这里 } )(); (function() { var qrcode = new QRCode('qrcode_2', { text: 'your content', width: 256, height: 256, colorDark : '#000000', colorLight : '#ffffff', correctLevel : QRCode.CorrectLevel.H } ); } )() </script> </body> </html>
|