Git地址
https://gitee.com/xujiulong/qr-code-generation.git
需求工具
qrcode.js http://davidshimjs.github.io/qrcodejs/
jquery.js `https://jquery.com/download/
代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>二维码生成</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="qrcode.min.js"></script>
</head>
<body>
<div id="payQrcodeDiv">
</div>
<script>
var str="erweimacode"; //要生成的内容
var qrcode = new QRCode($("#payQrcodeDiv")[0],{
width:200,
height:200
});
qrcode.makeCode(this.str);
</script>
</body>
</html>