亲测有效 javascript
须要的js文件有 jquery.qrcode.js 和 utf.js 以及 jquery-1.8.0.js 。还有一个 LOGO图片 可点击下载文件。html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>该二维码支持中文和LOGO</title> <script type="text/javascript" src="jquery-1.8.0.js"></script> <script type="text/javascript" src="utf.js"></script> <script type="text/javascript" src="jquery.qrcode.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#qrcodeCanvas").qrcode({ render : "canvas", //设置渲染方式,有table和canvas,使用canvas方式渲染性能相对来讲比较好 text : "<span style="font-family: Consolas, 'Courier New', Courier, mono, serif; line-height: 18px;">http://www.baidu.com</span>", //扫描二维码后显示的内容,能够直接填一个网址,扫描二维码后自动跳向该连接 width : "200", //二维码的宽度 height : "200", //二维码的高度 background : "#ffffff", //二维码的后景色 foreground : "#000000", //二维码的前景色 src: 'photo.jpg' //二维码中间的图片 }); }); </script> </head> <body> <center> <h2>该二维码支持中文和LOGO</h2> <div id="qrcodeCanvas"></div> </center> </body> </html>
2、源码下载java