JS生成条形码/二维码 barcode.js、JsBarcode
JS生成条形码/二维码 barcode、JsBarcode
- JsBarcode
- Barcode.js
以下代码均非纯原创。新手小白。网上一搜一大把的概念也不写了,直接上可运行的代码及遇到的小坑。
JsBarcode
有github,开源,github里也有xx.min.js文件,不用在别处花代币下。
JsBarcode-github:https://github.com/lindell/JsBarcode
- 不支持IE9;
- 找到JsBarcode.all.js及完整可运行项目,有需要的可以下载(运行截图如下)csdn下载;
- 简易运用如下(加了js包即可直接运行):
<!DOCTYPE html>
<html>
<head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no" /> <title></title> <script type="text/javascript" src="jquery-1.4.2.min.js"></script> <script type="text/javascript" src="JsBarcode.all.js"></script>
</head>
<body>
<p>1</p>
<!-- <svg id="svgcode"></svg> --><!-- or --> <!-- <canvas id="canvascode"></canvas> --><!-- or --> <img id="imgcode" /> <script> // $("#svgcode").JsBarcode('Hi!');//or // JsBarcode("#svgcode", "Hi!"); // $("#canvascode").JsBarcode('Hello world!');//or JsBarcode("#canvascode", "Hello world!"); $("#imgcode").JsBarcode("IE9NoSupport");//or JsBarcode("#imgcode", "IE9NoSupport"); </script>
</body>
</html>
Barcode.js
有github,开源,github里也有xx.min.js文件,不用在别处花代币下。
Barcode-github: https://github.com/jbdemonte/barcode
参考资料:http://www.uedsc.com/barcode-js.html
- 支持IE9;
- 完整可运行项目,有需要的可以下载(运行截图如下俩图)csdn下载;
- 简易运用如下(加了js包即可直接运行):
<!doctype html>
<html><head><title>jQuery Barcode</title><script type="text/javascript" src="jquery-1.3.2.min.js"></script><script type="text/javascript" src="../jquery-barcode.js"></script><style type="text/css">.barcodeImg{margin:10px 0px}</style></head><body><div style="margin:10px"> <input id="src" value="11225921991"></input><br/> <input type="button" onclick='code11()' value="code11"> <input type="button" onclick='code39()' value="code39"> <input type="button" onclick='code93()' value="code93"><input type="button" onclick='code128()' value="code128"><input type="button" onclick='ean8()' value="ean8"> <input type="button" onclick='ean13()' value="ean13"><input type="button" onclick='ean13()' value="std25"><input type="button" onclick='int25()' value="int25"><input type="button" onclick='msi()' value="msi"><input type="button" onclick='datamatrix()' value="datamatrix"><div id="bcTarget" class="barcodeImg"></div> </div><script type="text/javascript">function code11(){$("#bcTarget").empty().barcode($("#src").val(), "code11",{barWidth:2, barHeight:30,showHRI:false});}function code39(){$("#bcTarget").empty().barcode($("#src").val(), "code39",{barWidth:2, barHeight:30,showHRI:false});}function code93(){$("#bcTarget").empty().barcode($("#src").val(), "code93",{barWidth:2, barHeight:30,showHRI:false});}function code128(){$("#bcTarget").empty().barcode($("#src").val(), "code128",{barWidth:1, barHeight:30,showHRI:true,displayValue: true});}function ean8(){$("#bcTarget").empty().barcode($("#src").val(), "ean8",{barWidth:2, barHeight:30,showHRI:false});}function ean13(){$("#bcTarget").empty().barcode($("#src").val(), "ean13",{barWidth:2, barHeight:30,showHRI:false});}function std25(){$("#bcTarget").empty().barcode($("#src").val(), "std25",{barWidth:2, barHeight:30,showHRI:false});}function int25(){$("#bcTarget").empty().barcode($("#src").val(), "int25",{barWidth:2, barHeight:30,showHRI:false});}function msi(){$("#bcTarget").empty().barcode($("#src").val(), "msi",{barWidth:2, barHeight:30,showHRI:false});}function datamatrix(){$("#bcTarget").empty().barcode($("#src").val(), "datamatrix",{barWidth:2, barHeight:30,showHRI:false});}</script></body>
</html>
- 官方运用截图如下:
JS生成条形码/二维码 barcode.js、JsBarcode相关推荐
- H5案例分享:jquery.qrcode.js生成简易二维码
近期做项目需要生成二维码,并且解码获取信息,jquery.qrcode.js生成二维码比较的方便,写个教程分享给大家.欢迎大家测试留言,我会改进代码. 现在二维码越来越流行啦,支付扫二维码,关注扫二维 ...
- qrcode.js生成微信二维码
①安装qrcodejs2 npm install qrcodejs2 --save ②在页面中引入 import QRCode from "qrcodejs2" ③在html中设置 ...
- QR.js JS 生成 PNG二维码图片,使用说明
QR.js JS 生成 PNG二维码图片,使用说明 github 上的原文什么都没有提,我给 fork 了一个,并添加了使用说明 https://github.com/KyleBing/qr.js 一 ...
- 使用qrcode.js生成网址二维码
话不多说,直接上代码: <!DOCTYPE html> <html lang="zh-CN"><head><meta charset=&q ...
- 使用QRCode.js生成的二维码,隐藏title
鼠标悬停在二维码上,会显示title信息 隐藏title处理 let qrcodeCreater = new QRCode(document.getElementById("wechat_c ...
- python笔记 利用python 自动生成条形码 二维码
1. ean13标准条形码 from pystrich.ean13 import EAN13Encoderencode = EAN13Encoder('123123123123') encode.sa ...
- HTML网页使用CDN的jquery.qrcode.min.js生成页面二维码(直接可以复制使用)
HTML页面代码 <!DOCTYPE html> <html> <head><title></title><meta http-equ ...
- uni-app 109生成个人二维码名片
code.vue <template><view class="page"><!-- 导航栏 --><free-nav-bar title ...
- 手机移动端-纯js浏览器h5调用摄像头扫描识别解析 条形码+二维码
一.场景 手机移动端-原生js 浏览器h5 解决 识别二维码 条形码功能: 不借助Hbuilder.需要自己打包成APP,比如用Hbuilder打包,浏览器端项目h5 无打包成app部署 X 不采用 ...
最新文章
- quartus编译错误不支持芯片_介绍一下如何重新编译Arduino 16U2 的Firmware
- 按需生产 ,我们准备好了吗?
- python编程游戏手机版_利用Python开发手机同款游戏:开心消消乐
- Apache Storm 官方文档 —— 源码组织结构
- java动态代理_Java动态代理
- rest spring_带有Spring的REST的ETag
- “AI女神”李飞飞:如果我获诺贝尔奖,我一定以中国人身份去领奖
- quartus仿真系列3:74283的4位并行加法器
- 【数据库系统原理】实体-联系模型
- 超详细手把手教你App上线AppStore
- python从入门学习笔记
- 少儿创意学编程(Scratch基础篇):第5课——绘画板
- [WTL/ATL]_[Gdiplus]_[绘制虚线并设置破折号空格的宽度]
- 人工智能越来越“能”
- 这个“中台”不简单,将自然资源信息化全面带入三维世界
- shineblink MH-Z19C二氧化碳测量
- 和风天气 (简易版)
- 《软件登记测试报告》可以作为软件第三方检测报告使用吗
- SPI—读写串行FLASH(时序中的无关项)
- java70-GUL图形用户界面初识
热门文章
- FreeRTOS任务优先级和系统心跳Tick
- JavaScript 探查器工具
- c语言编码数字的范围,C语言数据类型的表示范围
- c++陈维兴第三版3.35_C++面向对象程序设计教程第3版—陈维兴,林小茶课后习题答案...
- LIGO探测到两个“瘦子”黑洞形成的引力波
- 微信小程序获取手机号,java后台
- 【数据分析与可视化】使用pyecharts对App下载量数据进行可视化分析(附源码)
- 网易视频云:构建一站式视频云点播平台的关键技术
- 怎么样做能让站点文章收录更快一些呢
- VM虚拟机中如何设置ip地址