【QRCode】 生成二维码图片

源码:

<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',
	  width: 256,
	  height: 256,
	  colorDark : '#000000',
	  colorLight : '#ffffff',
	  correctLevel : QRCode.CorrectLevel.H
	});
</script>
</body>

  

页面效果:

 

posted on 2021-08-10 15:47  清清飞扬  阅读(623)  评论(0编辑  收藏  举报