<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <script src="jquery3.4.1.min.js"></script> <script src="jquery.qrcode.min.js"></script> </head> <body> <div id="qrcodeCanvas"></div> </body> <script> $('#qrcodeCanvas').qrcode({ width : 300, height : 300, text : "写你的网址" }); </script> </html>
需要引入两个东西