js超简单的生成普通二维码+logo二维码,使用的是修改过的jquery.qrcode.js,就能支持带logo
代码如下
<script>
//有logo图
$('#qrcode').qrcode({
text: "https://www.wophost.cn",
height: 150,
width: 150,
src: 'https://www.wophost.cn/wp-content/uploads/2018/06/ico.png'
})
//无logo图
$('#qrcode2').qrcode({
text: "https://www.wophost.cn",
height: 150,
width: 150,
})
</script>
网页实例
<html>
<title>超简单的js生成二维码(可带logo)</title>
<meta charset="utf8">
<div align="center" id="qrcode"></div><br>
<div align="center" id="qrcode2"></div>
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
<script src="https://www.wophost.cn/js/jquery.qrcode.min.js"></script>
<script>
//有logo图
$('#qrcode').qrcode({
text: "https://www.wophost.cn",
height: 150,
width: 150,
src: 'https://www.wophost.cn/wp-content/uploads/2018/06/ico.png'
})
//无logo图
$('#qrcode2').qrcode({
text: "https://www.wophost.cn",
height: 150,
width: 150,
})
</script>
</html> 












发表评论: