源码:
<head>
<script type="text/javascript" src="qrcode.min.js"></script>
</head>
<body style="padding: 50px;">
<div>
<div>
<h3>参考: <a href="http://code.ciaoca.com/javascript/qrcode/">qrcode</a></h3>
</div>
<div id="qrcode"></div>
<div style="height: 50px;"></div>
<div id="qrcode2"></div>
</div>
<script type="text/javascript">
new QRCode(document.getElementById("qrcode"), "http://jindo.dev.naver.com/collie");
// 设置参数方式
var qrcode2 = new QRCode('qrcode2', {
text: 'what are you doing',
256,
height: 256,
colorDark : '#000000',
colorLight : '#ffffff',
correctLevel : QRCode.CorrectLevel.H
});
</script>
</body>
页面效果:
