qrcodejs实现二维码动态生成
测试代码:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<!--二维码生成插件-->
<script type="text/javascript" src="qrcode/qrcode.min.js"></script>
<body>
<div id="qrcode" style="width:200px; height:200px; margin-top:15px;margin: 0 auto;">
</body>
<script type="text/javascript">
//初始化二维码参数
var qrcode = new QRCode(document.getElementById("qrcode"), {
width : 200,
height : 200
});
(function () {
qrcode.makeCode("http://www.baidu.com");
})();
</script>
</html>
测试结果:

参考资料:
https://github.com/davidshimjs/qrcodejs
|
作者:onlystrive 出处:http://www.cnblogs.com/zyuc/ 本文版权归作者所有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接。 |
posted on 2018-06-22 13:51 onlystrive 阅读(1053) 评论(0) 收藏 举报
浙公网安备 33010602011771号