通过bower进行获取:

y@y:ydkt$ bower install jquery-qrcode --save
bower not-cached git://github.com/gcusnieux/jquery-qrcode.git#*
bower resolve git://github.com/gcusnieux/jquery-qrcode.git#*
bower checkout jquery-qrcode#master
bower resolved git://github.com/gcusnieux/jquery-qrcode.git#31e056e747
bower install jquery-qrcode#31e056e747 jquery-qrcode#31e056e747 client/bower_components/jquery-qrcode
y@y:ydkt$

使用:

.modal.fade(id="qrcode" role="dialog")
.modal-dialog
.modal-content
.modal-header
button.close(type="button" data-dismiss="modal" aria-label="Close")
span(aria-hidden="true") ×
h4.modal-title 在线生成二维码
.modal-body
form(name="qrcodeForm")
input.form-control(placeholder="请输入内容..." required="true" ng-change="createQrCode()" ng-model="qrcodeInfo")
br
#qrcodeCanvas.text-center
.modal-footer
button.btn.btn-default(data-dismiss="modal") 关闭
//在线生成二维码
$scope.createQrCode = function(){
//首先清除
jQuery('#qrcodeCanvas').html(""); if($scope.qrcodeInfo!==undefined){
jQuery('#qrcodeCanvas').qrcode({
width: 256,
height: 256,
text : toUtf8($scope.qrcodeInfo)
});
}
}; //解决二维码中的中文乱码问题
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-qrcode在线生成二维码的更多相关文章

  1. 使用jquery.qrcode.js生成二维码

    通常生成二维码的方式有两种:第一种是java代码的形式,第二种是通过Js方式. 在这里我做个记录,用js生成二维码,可以在官网下载源码:http://jeromeetienne.github.io/j ...

  2. 转: jquery.qrcode.js生成二维码插件&转成图片格式

    原文地址: https://blog.csdn.net/u011127019/article/details/51226104 1.qrcode其实是通过使用jQuery实现图形渲染,画图,支持can ...

  3. jquery.qrcode.js生成二维码(前端生成二维码)

    官网地址:http://jeromeetienne.github.io/jquery-qrcode/ 第一步引入插件: <script type='text/javascript' src='h ...

  4. jquery.qrcode.js 生成二维码并支持中文的方法

    GitHub地址: https://github.com/jeromeetienne/jquery-qrcode <div class="QR"></div> ...

  5. jquery.qrcode.js生成二维码

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  6. h5开发app之在线生成二维码

    h5通过jquery和qrcode在线生成二维码 首先我们需要下载一个qrcode.js文件,然后依次引入jquery和qrcode文件. 1.创建一个输入框以便做演示使用: <input id ...

  7. 利用QrCode.Net生成二维码 asp.net mvc c#

    利用QrCode.Net生成二维码 asp.net mvc c# 里面介绍了.net的方式及js的方式,还不错. 里面用到的qrcode.net的类库下载地址:https://qrcodenet.co ...

  8. QRCode.js生成二维码

    QRCode的GitHub地址: https://github.com/KeeeX/qrcodejs 该版本解决了主版本(https://github.com/davidshimjs/qrcodejs ...

  9. qrcode.js生成二维码因字符串过长而报错

    前端使用qrcode.js生成二维码的时候.有时候是会出现 qrcode length overflow (1632>1056) 目前使用的有效的解决办法是重新下载新版的qrcode.js 下载 ...

随机推荐

  1. HDOJ 1010

    深度搜索,注意要剪枝 1.奇偶剪枝 可以把map看成这样: 0 1 0 1 0 1 1 0 1 0 1 0 0 1 0 1 0 1 1 0 1 0 1 0 0 1 0 1 0 1 从为 0 的格子走一 ...

  2. ubuntu进入命令登录界面

    按ctrl+alt+F1或者ctrl+alt+F2进入系统终端,可以以命令行界面登录系统.

  3. MD5方法代码(生成小写的md5) C#版本

    public string GetMD5Str(string input) { // Use input string to calculate MD5 hash MD5 md5 = System.S ...

  4. C++读写文件并排序

    比如一条记录是 1987 9 2 1988 8 26 代表公司员工生日 然后需要读入到系统 现在需要放入容器,并且排序 最后输出到新的文件中,按照年龄由大到小. #include "stda ...

  5. [Javascript] Array methods in depth - filter

    Array filter creates a new array with all elements that pass the test implemented by the provided fu ...

  6. Linux命令之查找

    在Linux中,有非常多方法能够做到这一点.国外站点LinuxHaxor总结了五条命令,你能够看看自己知道几条.大多数程序猿,可能常常使用当中的2到3条,对这5条命令都非常熟悉的人应该是不多的. 1. ...

  7. boost 相等与等价的区别

  8. mysql 热备

    全备份:(生成时间戳文件夹:2016-04-20_16-12-01)innobackupex --users=root --password=root /tmp/backup 第一次增量备份:(生成时 ...

  9. UVA 11770 Lighting Away

    RunID User Problem Result Memory Time Language Length Submit Time 2482977 zhyfzy J Accepted 0 KB 138 ...

  10. JAVA小项目之摇奖机

    功能: 点击”摇杆“开始: 两种结束滚动方式,A:点击”摇杆“ B:分别点击 对应结果框的按钮: 实现最后减速停下来效果,模拟真实摇奖机. 知识点:A.线程的控制,B.图片轮播原理 效果图:   窗口 ...