使用QRCode生成二维码
2016-11-25 16:15
176 查看
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script type='text/javascript' src='http://cdn.staticfile.org/jquery/2.1.1/jquery.min.js'></script> <script type="text/javascript" src="http://cdn.staticfile.org/jquery.qrcode/1.0/jquery.qrcode.min.js"></script> <script> $(document).ready(function(){ function toUtf8(str) { var out, i, len, c; out = ""; len = str.length; for(i = 0; i < len; i++) { c = str.charCodeAt(i); if ((c >= 0x0001) && (c <= 0x007F)) { out += str.charAt(i); } else if (c > 0x07FF) { out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F)); out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F)); out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F)); } else { out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F)); out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F)); } } return out; } jQuery('#code').qrcode(toUtf8("哈哈哈哈!")); }); </script> </head> <body> <div id="code"></div> </body> </html>
调整二维码方法
相关文章推荐
- 使用jquery-qrcode生成二维码
- 使用jquery-qrcode生成二维码
- Python使用QRCode模块生成二维码
- 使用jquery-qrcode生成二维码
- thinkphp使用phpqrcode生成带logo二维码
- 使用PHP生成二维码(PHPQRCode)
- 使用jquery-qrcode生成二维码
- 使用phpqrcode生成二维码
- Python3 qrcode的使用(生成二维码)
- Python使用QRCode生成二维码
- 使用jquery-qrcode在页面上生成二维码,支持中文
- Python二维码生成库qrcode安装和使用示例
- php生成二维码,使用qrcode类库创建
- Python使用QRCode模块生成二维码
- 使用zxing生成QRCode二维码,在Android的webview中调用条形码扫描(转)
- 使用jquery-qrcode生成二维码(兼容中文)
- Android及Java使用google.zxing生成和解码(解析)二维码(QRCode)
- 使用jquery-qrcode生成二维码
- 使用jquery-qrcode生成二维码
- Sae使用storage保存phpqrcode生成的二维码