js生成二维码
js生成二维码demo:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>js生成二维码</title> </head> <body> <div id="messagQrcodes"></div> </body> <script src="jquery.min.js"></script> <script src="qrcode.js"></script> <script> function qcrodes(url){ var qrcode = new QRCode(document.getElementById("messagQrcodes"),{ width:200, height:200, colorDark:"#000", colorLight:"#fff" }); qrcode.makeCode(url);//生成二维码 // qrcode.clear();//清除二维码 } qcrodes("https://www.baidu.com"); </script> </html>
运行结果:
demo链接:链接:https://pan.baidu.com/s/1E_m5VfSDkNfvJPijRwh3SA 密码:66wb