JS 生成二维码
1 | 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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | <! DOCTYPE html> < html > < head > < meta charset="utf-8" /> < meta name="referrer" content="always" /> < meta http-equiv="X-UA-Compatible" content="IE=edge" /> < meta http-equiv="content-type" content="text/html; charset=utf-8" /> < meta name="renderer" content="webkit" /> < meta name="keywords" content="JS 生成二维码" /> < meta name="description" content="JS 生成二维码" /> < title >JS 生成二维码 -by wgscd</ title > </ head > < body > < script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.5.1/jquery.min.js"></ script > < script src="https://cdn.bootcdn.net/ajax/libs/jquery.qrcode/1.0/jquery.qrcode.min.js"></ script > < div id="output"></ div > < script > // 转中文内容UTF-8 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; } // 设置二维码参数 function make() { $('#output').qrcode({ render: "table", // 设置渲染方式(有两种方式 table和canvas,默认是canvas) width: 200, // 宽度 height: 200, // 高度 background: "#FFFFFF", // 背景颜色 foreground: "#000000", // 前景颜色 correctLevel: 0, // 纠错等级 src: 'images/logo4.png', text: 'http://www.baidu.com/888' //text: toUtf8("二维码生成前端插件:jquery.qrcode.min.js") // 任意内容 }); } make(); </ script > < center > < p >JS 生成二维码</ p > </ center > </ body > </ html > |
fffffffffffffffff
test red font.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 【杭电多校比赛记录】2025“钉耙编程”中国大学生算法设计春季联赛(1)
2023-07-28 wpf ScrollViewer 滚动动画
2021-07-28 WPF 设置Button的content为多行模式
2016-07-28 Advanced Find and Replace(文件内容搜索替换工具)v7.8.1简体中文破解版