前端自动生成条码码插件-JsBarcode.all.min.js

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!DOCTYPE html>
<html lang="en">
  
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>js生成条形码插件</title>
    <script src="https://cdn.bootcss.com/jsbarcode/3.8.0/JsBarcode.all.min.js"></script>
    <style>
        * {margin: 0;padding: 0;box-sizing: border-box;}
        h3 {text-align: center;font-size: 16px;margin: 10px;}
        .box {text-align: center;}
        #barcode {width: 200px;}
    </style>
</head>
  
<body>
    <h3>js自动生成条形码插件-JsBarcode</h3>
    <div class="box">
        <img id="barcode" />
    </div>
     
</body>
<script>
    var barcode = document.getElementById('barcode'),
        str = "1234567890",
        options = {
            format: "CODE128",
            displayValue: true,
            fontSize: 18,
            height: 100
        };
    JsBarcode(barcode, str, options); //原生
    // $('#barcode').JsBarcode(string, options); //jQuery
</script>
  
</html>

  

附本地JS文件:点我下载

作者:itbaby

出处:https://www.cnblogs.com/itbaby/p/15528859.html

版权:本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议进行许可。

posted @   知风阁  阅读(1136)  评论(0编辑  收藏  举报
编辑推荐:
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
阅读排行:
· 阿里最新开源QwQ-32B,效果媲美deepseek-r1满血版,部署成本又又又降低了!
· 单线程的Redis速度为什么快?
· SQL Server 2025 AI相关能力初探
· AI编程工具终极对决:字节Trae VS Cursor,谁才是开发者新宠?
· 展开说说关于C#中ORM框架的用法!
more_horiz
keyboard_arrow_up light_mode palette
选择主题
点击右上角即可分享
微信分享提示