使用qrcode.js生成二维码图片
2017-06-19 16:28
609 查看
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ko" lang="ko"> <head> <title>Javascript 二维码生成库:QRCode</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=no" /> <script type="text/javascript" src="http://cdn.static.runoob.com/libs/jquery/2.1.1/jquery.min.js"></script> <script type="text/javascript" src="http://static.runoob.com/assets/qrcode/qrcode.min.js"></script> </head> <body> <input id="text" type="text" value="http://www.runoob.com" style="width:80%" /><br /> <div id="qrcode" style="width:100px; height:100px; margin-top:15px;"></div> <script type="text/javascript"> var qrcode = new QRCode(document.getElementById("qrcode"), { width : 100, height : 100 }); function makeCode () { var elText = document.getElementById("text"); if (!elText.value) { alert("Input a text"); elText.focus(); return; } qrcode.makeCode(elText.value); } makeCode(); $("#text"). on("blur", function () { makeCode(); }). on("keydown", function (e) { if (e.keyCode == 13) { makeCode(); } }); </script> </body> </html>
相关文章推荐
- vue.js中使用QRCode生成二维码
- 毛超帅 使用 jquery.qrcode.js 生成网站地址url二维码图片______软件开发-JAVA
- 【QRcode二维码】:使用JS前端插件QRcode.js生成二维码
- Laravel使用PHPQRCODE实现生成带有LOGO的二维码图片功能示例
- asp.net(C#)使用QRCode生成图片中心加Logo或图像的二维码实例
- springmvc中使用qrgen(QRCode)生成二维码图片并显示在前台html img标签中
- php使用phpqrcode类库生成带图片LOGO的二维码
- Java使用谷歌的zxing生成二维码Qrcode并解析提取二维码图片内容
- 使用JavaScript生成二维码教程-附qrcodejs中文文档
- 使用JS生成二维码QRCode
- 使用qrcode.js生成二维码
- Python下使用qrcode模块生成vCard电子名片二维码图片
- 使用JS 插件qrcode.js生成二维码功能
- php使用phpqrcode类库生成带图片LOGO的二维码
- Python使用QRCode模块生成二维码
- 使用python调用zxing库生成二维码图片
- asp.net(C#)利用QRCode生成二维码(续)-在二维码图片中心加Logo或图像 .
- 使用jquery-qrcode生成二维码
- java生成二维码使用QRCode和ZXing两种方式