js 二维码

https://larsjung.de/jquery-qrcode/

源码

<!DOCTYPE html>
<html>
<head>
    <title>js-二维码</title>
</head>

<body>
    <div id="qrCode"></div>
    <img id="logo" style="display: none;" src="logo.jpg" />
    <script type="text/javascript" src="jquery-2.2.0.min.js"></script>
    <script type="text/javascript" src="jquery.qrcode.min.js"></script>
    <script type="text/javascript">
        window.onload = function () {
            $("#qrCode").qrcode({
                render: 'canvas',
                ecLevel: 'H',
                text: 'http://www.youfeidao.com',
                size: 300,
                mode: 4,
                mSize: 0.12,
                image: $('#logo')[0],
                quiet: 0
            });
        }
    </script>
</body>
</html>

 

posted @ 2016-03-04 10:12  lonlie  阅读(188)  评论(0编辑  收藏  举报