qrcode插件生成二维码

来源:互联网 发布:阿里云华北5是哪里 编辑:程序博客网 时间:2024/04/25 16:46

话不多说,直接上代码

<!DOCTYPE html><html lang="en"><head>    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">    <title>生成带logo的二维码</title></head><body onload="createQrcode()"><!--    <div>        <input type="url" name="" placeholder="http://www.wifiuncle.com" id="url">        <button onclick="createQrcode()">点击生成</button>    </div> -->    <div id='qrcode' style='margin-left: 45%; margin-top: 10%'></div>    <script src="../jquery-2.2.4.min.js"></script>    <script src="./qrcode.js"></script>    <script src="./utf.js"></script>    <script type="text/javascript" src="./jquery.qrcode.js" ></script>    <script type="text/javascript">        function makeCode(url) {            $("#qrcode").qrcode({                render    : "canvas",                text    : url,                width : "200",               //二维码的宽度                height : "200",              //二维码的高度                background : "#ffffff",       //二维码的后景色                foreground : "#000000",        //二维码的前景色                src: './logo.jpg'             //二维码中间的图片            });        }        function createQrcode () {            var url = 'http://www.wifiuncle.com;';//$('#url').val();            makeCode(url);        }    </script></body></html>

效果图:
这里写图片描述
插件下载地址:
https://github.com/davidshimjs/qrcodejs
代码打包下载:
http://download.csdn.net/detail/wx11408115/9904914
能用就点个赞再走呗~~~~

0 0