jquery生成二维码

<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>二维码</title>
</head>
<style>
    #qrcode{
        position: relative;
        width: 400px;
        height: 400px;
        margin: 0 auto;
    }
    .logo{
        position: absolute;
        width: 100px;
        margin: auto;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        height: 37px;
        z-index: 222;
    }
    .logo img{
        width: 100px;
    }
</style>
<body>
    


<div id="qrcode">
    <div class="logo">
        <img src="1.jpg" alt="">
    </div>
</div>
</body>
<script type='text/javascript' src='http://cdn.staticfile.org/jquery/2.1.1/jquery.min.js'></script>
<script type="text/javascript" src="http://cdn.staticfile.org/jquery.qrcode/1.0/jquery.qrcode.min.js"></script>
<script>
$(function(){
    //$('#qrcode').qrcode("http://pmi.yoopay.cn/");
    // 更详细的配置
         $('#qrcode').qrcode({
            text: "http://pmi.yoopay.cn/", // 要编码的字符串
             400, // 定义宽度
             height: 400, // 定义高度
             background: "#fff", // 背景色
            foreground: "black" // 前景色
       // qrcode.clear(); // 清除二维码
}); }) </script> </html>

原文地址:https://www.cnblogs.com/mymission/p/5765874.html