<!DOCTYPE HTML> <html> <head> <meta charset="utf-8"> <title>演示:使用jquery.qrcode生成二維碼</title> <script type="text/javascript" src="js/common/jquery.min.js"></script> <script type="text/javascript" src="js/qrcode/jquery.qrcode.min.js"></script> <script type="text/javascript"> $(function(){ var str = "http://www."; $('#code').qrcode(str); $("#sub_btn").click(function(){ $("#code").empty().qrcode({ render: "table", width: 200, height:200, text: str }); }); }) </script> </head> <body> <div class="demo"> <p>請輸入內(nèi)容然后提交生成二維碼:</p> <p><input type="text" class="input" id="mytxt" value=""> <input type="button" id="sub_btn" value="提交"></p> <div id="code"></div> </div> </body> </html> |
|