jquery-qrcode在线生成二维码
通过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在线生成二维码的更多相关文章
- 使用jquery.qrcode.js生成二维码
通常生成二维码的方式有两种:第一种是java代码的形式,第二种是通过Js方式. 在这里我做个记录,用js生成二维码,可以在官网下载源码:http://jeromeetienne.github.io/j ...
- 转: jquery.qrcode.js生成二维码插件&转成图片格式
原文地址: https://blog.csdn.net/u011127019/article/details/51226104 1.qrcode其实是通过使用jQuery实现图形渲染,画图,支持can ...
- jquery.qrcode.js生成二维码(前端生成二维码)
官网地址:http://jeromeetienne.github.io/jquery-qrcode/ 第一步引入插件: <script type='text/javascript' src='h ...
- jquery.qrcode.js 生成二维码并支持中文的方法
GitHub地址: https://github.com/jeromeetienne/jquery-qrcode <div class="QR"></div> ...
- jquery.qrcode.js生成二维码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- h5开发app之在线生成二维码
h5通过jquery和qrcode在线生成二维码 首先我们需要下载一个qrcode.js文件,然后依次引入jquery和qrcode文件. 1.创建一个输入框以便做演示使用: <input id ...
- 利用QrCode.Net生成二维码 asp.net mvc c#
利用QrCode.Net生成二维码 asp.net mvc c# 里面介绍了.net的方式及js的方式,还不错. 里面用到的qrcode.net的类库下载地址:https://qrcodenet.co ...
- QRCode.js生成二维码
QRCode的GitHub地址: https://github.com/KeeeX/qrcodejs 该版本解决了主版本(https://github.com/davidshimjs/qrcodejs ...
- qrcode.js生成二维码因字符串过长而报错
前端使用qrcode.js生成二维码的时候.有时候是会出现 qrcode length overflow (1632>1056) 目前使用的有效的解决办法是重新下载新版的qrcode.js 下载 ...
随机推荐
- java的异常处理简介
异常概述 任何一种程序设计语言设计的程序在运行时都有可能出现错误,例如除数为0,数组下标越界,要读写的文件不存在等等. 捕获错误最理想的是在编译期间,但有的错误只有在运行时才会发生. 对于这些错误,一 ...
- java下载csv文件,中文标题
@RequestMapping(value = "/export.do") public void exportpushuserByareacode(HttpServletRequ ...
- linux关闭防火墙及selinux
RHEL6.5 查看linux防护墙状态: service iptables status 关闭linux防火墙: 1)永久关闭,重启后生效 开启: chkconfig iptables on 关闭: ...
- HDU3631:Shortest Path(Floyd)
Problem Description When YY was a boy and LMY was a girl, they trained for NOI (National Olympiad in ...
- Ios17个常用代码整理
.判断邮箱格式是否正确的代码 //利用正则表达式验证 -(BOOL)isValidateEmail:(NSString *)email { NSString *emailRegex = @" ...
- Android 使用 RemoteViews 发送自定义通知 ,遇到 Couldn't expand RemoteViews问题总结
在RemoteViews这种调用方式中,你只能使用以下几种界面组件: Layout: FrameLayout, LinearLayout, RelativeLayout Component: ...
- Arduino 数码管LED屏驱动
今天測试数码管LED屏驱动,用某产品的一个共阴极的LED屏,依据电路图做数码管LED屏的检測. 代码写得有些冗长,有好几种驱动的方法,这里仅仅是当中一种最直接的方案,抽出时间要做个更有效率的调用和驱动 ...
- cas 官方文档
1. 架构 http://jasig.github.io/cas/4.0.0/planning/Architecture.html System Components The CAS server a ...
- 通知中心 NSNotificationCenter
NSNotificationCenter 通知中心提供了一种在程序内广播信息的途径,一个NSNotificationCenter对象本质上是一个通知分发表(notification dispatch ...
- Debian 桌面美化
Debian 桌面美化 安装 gnome-tweak-tool aptitude install gnome-tweak-tool 登陆gnome-look下载主题包 gnome-look上有很多主题 ...