jQuery生成QRcode二维码

jQuery生成QRcode二维码示例

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>jQuery生成QRCode二维码</title>
</head>
<body>
    <!-- 存放二维码 -->
    <div id="qrcode-1"></div>
    <!-- 存放二维码 -->
    <div id="qrcode-2"></div>
    <!-- 引入jQuery文件 -->
    <script src="https://cdn.bootcss.com/jquery/3.0.0/jquery.min.js"></script>
    <!-- 引入jQuery.qrcode文件 -->
    <script src="https://cdn.bootcss.com/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
    <script>
    //第一种方法
    $('#qrcode-1').qrcode("This is the first method");
    //第二种方法
    $('#qrcode-2').qrcode({
      width: 128,    //二维码宽度
      height: 128,   //二维码高度
      text: "This is the second method"      //字符串内容
    });
</script>
</body>
</html>

  

本文链接:https://www.cnblogs.com/connect/p/web-jquery-qrcode.html

posted @ 2017-08-11 11:39  varlemon  阅读(267)  评论(0编辑  收藏  举报