![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
JS
weixin_43962846
这个作者很懒,什么都没留下…
展开
-
js 文件下载/导出的方法合集
一、数据导出为excel1、方法一(创建a标签)<html><head> <p style="font-size: 20px;color: red;">使用a标签方式将json导出csv文件</p> <button οnclick='tableToExcel()'>导出</button></head><body> <script> func...原创 2021-05-26 10:48:02 · 233 阅读 · 0 评论 -
JavaScript 实现屏幕截图
需要安装file-saver,html2canvas插件handleExport() { let htmlDom = document.querySelector('#domId'); var FileSaver = require('file-saver'); html2canvas(htmlDom, { allowTaint: false, //允许污染 taintTest: true, //在渲染前测试图片 .原创 2021-03-19 14:10:28 · 700 阅读 · 0 评论 -
js 身份证号码信息验证
const IDValidator = require('id-validator-modify');const GB2260 = require('id-validator-modify/src/GB2260');async findInfoByIDNum(IDNum) { const Validator = new IDValidator(GB2260); const isValid = Validator.isValid(IDNum); if (isValid) { .原创 2021-02-08 15:02:55 · 319 阅读 · 0 评论 -
docx、pptx模板插件docxtemplater
官方文档:https://docxtemplater.readthedocs.io/en/latest/goals.htmldemo演示地址:https://docxtemplater.com/demo/原创 2021-01-08 09:39:19 · 563 阅读 · 0 评论 -
html导出为doc格式
exportToDoc(title='', content=''){ const htmlStr = `<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0".原创 2020-12-21 13:57:19 · 293 阅读 · 0 评论 -
搞清clientHeight、offsetHeight、scrollHeight、offsetTop、scrollTop
转载自zsxrping每个HTML元素都具有clientHeight offsetHeight scrollHeight offsetTop scrollTop 这5个和元素高度、滚动、位置相关的属性,单凭单词很难搞清楚分别代表什么意思之间有什么区别。通过阅读它们的文档总结出规律如下:clientHeight和offsetHeight属性和元素的滚动、位置没有关系它代表元素的高度,其中:c...转载 2019-02-23 13:14:35 · 95 阅读 · 0 评论 -
鼠标滚轮事件详解
//兼容性写法,该函数也是网上别人写的,不过找不到出处了,蛮好的,所有我也没有必要修改了//判断鼠标滚轮滚动方向if (window.addEventListener)//FF,火狐浏览器会识别该方法 window.addEventListener('DOMMouseScroll', wheel, false);window.onmousewheel = document.onmo...转载 2019-02-24 13:06:01 · 245 阅读 · 0 评论