通过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. 线性表(gcc实现)

    线性结构: ①存在一个唯一的被称为“第一个”的数据元素: ②存在一个唯一的被称为“最后一个”的数据元素: ③除第一个元素外,每个元素均有唯一一个直接前驱: ④除最后一个元素外,每个元素均有唯一一个直接 ...

  2. 转:有关Java泛型的类型擦除(type erasing)

    转载自:拈花微笑 自从Java 5引入泛型之后,Java与C++对于泛型不同的实现的优劣便一直是饭后的谈资.在我之前的很多training中,当讲到Java泛型时总是会和C++的实现比较,一般得出的结 ...

  3. springmvc实现REST中的GET、POST、PUT和DELETE

    spring mvc 支持REST风格的请求方法,GET.POST.PUT和DELETE四种请求方法分别代表了数据库CRUD中的select.insert.update.delete,下面演示一个简单 ...

  4. FLEX 图片拷贝

    在用FLEX做GIS相关的开发的时候,遇到一个问题.因为是监控类的系统,所以需要要求地图上的ICON的实时更新,从而会出现重复加载的情况.就是重复请求相同的图片用做背景,尤其是在加载的ICON较多的时 ...

  5. cocos2d-x 2.2.3 之菜单分析(1)

    TextEdit-Menu CCtextFieldTTF cocos2d – x 中提供的 bool T04ZORDER::init() { if (!CCLayer::init()) { retur ...

  6. [Redux] Implementing Store from Scratch

    Learn how to build a reasonable approximation of the Redux Store in 20 lines. No magic! const counte ...

  7. word2vec浅析

    本文是參考神经网络语言模型.word2vec相关论文和网上博客等资料整理的学习笔记.仅记录 自己的学习历程,欢迎拍砖. word2vec是2013年google提出的一种神经网络的语言模型,通过神经网 ...

  8. [转] GPS坐标转换经纬度及换算方法

    GPS坐标和经纬度的算法和概率不太一样,但是我们可能会将他们互通起来用,下面先贴上我做的转换工具:http://map.yanue.net/gps.html.里面实现了gps到谷歌地图百度地图经纬度的 ...

  9. Mounting File Systems

    1.Mounting File Systems Just creating a partition and putting a file system on it is not enough to s ...

  10. 从BufferedImage到InputStream,实现绘图后进行下载(生成二维码图片并下载)

    @SuppressWarnings("resource") public void download() throws Exception{ String filename = & ...