Js 中文 base64处理
摘要:中文转64:btoa(unescape(encodeURIComponent('中华人民共和国')))输出:5Lit5Y2O5Lq65rCR5YWx5ZKM5Zu9转回中文:decodeURIComponent(escape(atob('5Lit5Y2O5Lq65rCR5YWx5ZKM5Zu9'))
阅读全文
posted @
2024-09-25 14:57
wakaka_wka
阅读(54)
推荐(0) 编辑
JS 控制并行度
摘要:const urls = ["url1", "url2", ... ,"url100"]; const maxConcurrentNum = 10; // 最大并发数 // 数组分块,chunk表示每批次数量,返回数组二维数组 function chunk(arr, chunk) { let res
阅读全文
posted @
2024-06-17 20:54
wakaka_wka
阅读(6)
推荐(0) 编辑
System.Convert.ToBase64String 对应 JS 实现
摘要:function convertToBase64String(input) { // 将字符串转换为 Base64 编码的字符串 return btoa(unescape(encodeURIComponent(input))); } // 测试转换函数 const inputString = "中国
阅读全文
posted @
2024-05-28 11:42
wakaka_wka
阅读(23)
推荐(0) 编辑
JS 移除对象数组中,属性值全为空的项
摘要:const array = [ { id: 1, name: 'John', age: 25 }, { id: 2, name: 'Alice', age: null }, { id: 3, name: 'Bob', age: undefined }, { id: 4, name: 'Eve', a
阅读全文
posted @
2024-04-17 10:27
wakaka_wka
阅读(441)
推荐(0) 编辑
ExtJs GridPanel column Text Color
摘要:CSS: .x-column-header-text-inner{ color:red; } JS: $('.x-column-header-text-inner').filter(function(){ return (/启用/i).test($(this).text())}).css('colo
阅读全文
posted @
2022-09-15 21:26
wakaka_wka
阅读(17)
推荐(0) 编辑
Excel 列序数转列字母表达
摘要:1 function printString(n){ 2 let arr = []; 3 let i = 0; 4 5 // Step 1: Converting to number assuming 6 // 0 in number system 7 while (n) { 8 arr[i] =
阅读全文
posted @
2022-04-18 11:38
wakaka_wka
阅读(102)
推荐(1) 编辑
SQL Server 计算经纬度直线距离
摘要:declare @Lng decimal(18,6)=114.059920--经度declare @Lat decimal(18,6)=22.544884--纬度 declare @GPSLng decimal(18,6)=114.056300--经度declare @GPSLat decimal(
阅读全文
posted @
2022-04-15 23:23
wakaka_wka
阅读(274)
推荐(0) 编辑
NodeJs spawn
摘要:let spawn = require("child_process").spawn; let bat = spawn("cmd.exe", [ "/c", // Argument for cmd.exe to carry out the specified script "D:\test.bat"
阅读全文
posted @
2022-02-26 23:29
wakaka_wka
阅读(664)
推荐(0) 编辑
ExtJs Window 显示 HTML
摘要:var win = new Ext.Window({ title: 'My Window', width: 640, height: 400, preventBodyReset: true, html: '<h1>This should be the way you expect it!</h1>'
阅读全文
posted @
2021-11-27 18:02
wakaka_wka
阅读(153)
推荐(0) 编辑
Js Get 检测是否404
摘要:$.get( "http://img12.360buyimg.com/n1/jfs/t1/207023/2/4302/290376/61613c6eEc2e68f8b/51c92e09054c4001.jpg", function() { debugger;alert( "success" );})
阅读全文
posted @
2021-10-25 17:20
wakaka_wka
阅读(258)
推荐(0) 编辑
JS 判断是否是有效的日期
摘要:function IsValidDate(date) { return date instanceof Date && !isNaN(date.getTime()); }
阅读全文
posted @
2021-09-10 09:29
wakaka_wka
阅读(315)
推荐(0) 编辑
JS 获取每月第一天和最后一天
摘要:var date = new Date(); var firstDay = new Date(date.getFullYear(), date.getMonth(), 1); var lastDay = new Date(date.getFullYear(), date.getMonth() + 1
阅读全文
posted @
2021-08-31 10:44
wakaka_wka
阅读(389)
推荐(0) 编辑
JS 截取去掉末尾一个字符
摘要:str = "12345.00"; str = str.slice(0, -1); console.log(str);或者 let str = "12345.00"; str = str.substring(0, str.length - 1); console.log(str);
阅读全文
posted @
2021-07-21 16:47
wakaka_wka
阅读(383)
推荐(0) 编辑
Chrome 扩展编写
摘要:https://www.formget.com/chrome-extension-inject-javascript/ How to Inject JavaScript Using Chrome Extension | FormGet
阅读全文
posted @
2021-06-16 09:46
wakaka_wka
阅读(22)
推荐(0) 编辑
Js 判断对象数组是否包含特别属性值的对象
摘要:[{},{},...].findIndex(function(x){return x.属性名=='属性值'}) 返回值 >=0 表示存在
阅读全文
posted @
2021-06-01 10:24
wakaka_wka
阅读(117)
推荐(0) 编辑
Vue 强制UI重绘
摘要:// 全局 import Vue from 'vue'; Vue.forceUpdate(); // 使用组件实例 export default { methods: { methodThatForcesUpdate() { // ... this.$forceUpdate(); // ... }
阅读全文
posted @
2021-05-19 14:31
wakaka_wka
阅读(824)
推荐(0) 编辑
JS 数组移除元素
摘要:1. Remove all undefined values An undefined value automatically gets assigned in JavaScript where no value has been explicitly assigned. To remove all
阅读全文
posted @
2021-02-22 23:36
wakaka_wka
阅读(159)
推荐(0) 编辑
JS 图片旋转
摘要:var pr=0; $('.strp-content-element').click(function(){pr=(pr+90)%360; this.style.transform = 'rotate('+pr+'deg) scale(.8)';});
阅读全文
posted @
2020-10-31 12:35
wakaka_wka
阅读(147)
推荐(0) 编辑
JS 获取当前日期加一天之后的日期
摘要:new Date(( new Date()).getTime()+1000*60*60*24);
阅读全文
posted @
2020-07-07 22:36
wakaka_wka
阅读(3172)
推荐(0) 编辑
JS 数组去重
摘要:function unique (arr) { return Array.from(new Set(arr)) } var arr = [1,1,'true','true',true,true,15,15,false,false, undefined,undefined, null,null, Na
阅读全文
posted @
2020-03-19 23:55
wakaka_wka
阅读(115)
推荐(0) 编辑