随笔分类 -  js

摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="style 阅读全文
posted @ 2024-08-07 16:15 蓝色精灵jah 阅读(272) 评论(0) 推荐(0) 编辑
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2024-05-17 14:41 蓝色精灵jah 阅读(5) 评论(0) 推荐(0) 编辑
摘要:使用 Set 数据结构:将数组转换为 Set,如果 Set 的长度为 1,则说明数组中所有的值都相同。 使用 for 循环:遍历数组,将每个元素与前面的元素进行比较,如果存在不同的元素,则说明数组中的所有值不相同。 使用 Array.prototype.every() 方法:使用 every 方法遍 阅读全文
posted @ 2024-05-17 14:14 蓝色精灵jah 阅读(2441) 评论(0) 推荐(0) 编辑
摘要:1. table() console.table(): 可以很轻松的将对象数组显示为表格,每个对象一行,每个属性一列。 2. trace() 我们可以使用trace()来获取我们的调用堆栈,对于调试非常管用。 3. count() console.count()可以记录当前方法的调用次数。看下面这个 阅读全文
posted @ 2024-03-20 09:30 蓝色精灵jah 阅读(14) 评论(0) 推荐(0) 编辑
摘要:《1》a 标签的 href 有很大的关系, href 属性的地址必须是 同源 URL,否则,download 就会不起作用。 1. 同源 URL 会进行 下载 操作2. 非同源 URL 会进行 导航 操作3. 非同源的资源 仍需要进行下载,那么可以将其转换为 blob: URL 形式 《2》a标签的 阅读全文
posted @ 2024-01-10 16:06 蓝色精灵jah 阅读(181) 评论(0) 推荐(0) 编辑
摘要:.doc——data:application/msword;base64, .docx——data:application/vnd.openxmlformats-officedocument.wordprocessingml.document;base64, .xls——data:applicati 阅读全文
posted @ 2023-12-22 09:30 蓝色精灵jah 阅读(2409) 评论(1) 推荐(0) 编辑
摘要:1 2 $(document).mouseup(function(e) { 3 var pop = $('popDialog'); 4 if(!pop.is(e.target) && pop.has(e.target).length 0) { 5 // 可以在这里关闭弹窗 6 some code.. 阅读全文
posted @ 2023-10-30 11:16 蓝色精灵jah 阅读(341) 评论(0) 推荐(0) 编辑
摘要:如题,有时候需要对树形数组深层去找符合字段的那一串json,苦于循环找太费劲,索引选择扁平化,找起来方便很多 let treeList = [{ id: '1', name: '水果', value: 3, children: [{ id: '1-1', name: '西瓜', value: 2, 阅读全文
posted @ 2023-10-25 11:19 蓝色精灵jah 阅读(84) 评论(0) 推荐(0) 编辑
摘要:// 计算总页码function pageCount(totalnum, limit) { return totalnum > 0 ? ((totalnum < limit) ? 1 : ((totalnum % limit) ? (parseInt(totalnum / limit) + 1) : 阅读全文
posted @ 2023-09-01 15:14 蓝色精灵jah 阅读(59) 评论(0) 推荐(0) 编辑
摘要:16进制转rgba 阅读全文
posted @ 2023-08-08 11:01 蓝色精灵jah 阅读(659) 评论(0) 推荐(0) 编辑
摘要:转载于:https://juejin.cn/post/7132714583399071758 阅读全文
posted @ 2023-01-14 15:47 蓝色精灵jah 阅读(24) 评论(0) 推荐(0) 编辑
摘要:方法一、 function isHasImg( src ){ var img = new Image(); img.src = src; img.onload = function(){ if( img.width > 0 || img.height > 0 ){ onImgExistNotify( 阅读全文
posted @ 2022-09-27 20:50 蓝色精灵jah 阅读(289) 评论(0) 推荐(0) 编辑
摘要:希望最终停在B页,不想点B页浏览器返回按钮,返回到A页,则在A页加: $(document).ready(function(){ window.history.forward(1); }) 阅读全文
posted @ 2022-09-02 17:51 蓝色精灵jah 阅读(134) 评论(0) 推荐(0) 编辑
摘要:1 <body> 2 <button onclick="save()">提交按钮</button> 3 <script> 4 var lock = false; 5 function save() { 6 if (lock) { 7 return false 8 } 9 lock = true; 1 阅读全文
posted @ 2022-02-25 16:30 蓝色精灵jah 阅读(62) 评论(0) 推荐(0) 编辑
摘要:https://blog.csdn.net/gm0125/article/details/88867293 阅读全文
posted @ 2022-01-27 16:12 蓝色精灵jah 阅读(265) 评论(0) 推荐(0) 编辑
摘要:1 <!DOCTYPE html> 2 <html lang="en"> 3 4 <head> 5 <meta charset="UTF-8"> 6 <meta http-equiv="X-UA-Compatible" content="IE=edge"> 7 <meta name="viewpor 阅读全文
posted @ 2021-12-16 16:54 蓝色精灵jah 阅读(629) 评论(0) 推荐(0) 编辑
摘要:<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="wi 阅读全文
posted @ 2021-12-15 17:58 蓝色精灵jah 阅读(396) 评论(0) 推荐(0) 编辑
摘要:<script> var data = [ { id: 1, name: 'test' }, { id: 2, name: 'test2' }, { id: 3, name: 'test3' }, { id: 4, name: 'test4' }, { id: 5, name: 'test5' }, 阅读全文
posted @ 2021-12-02 18:03 蓝色精灵jah 阅读(566) 评论(0) 推荐(0) 编辑
摘要:原文地址:https://blog.csdn.net/qq_35629054/article/details/108147122 阅读全文
posted @ 2021-12-01 18:24 蓝色精灵jah 阅读(492) 评论(0) 推荐(0) 编辑
摘要:写法一、 <body> <div class="js-img"> <!--<img src="" >--> </div> <script> var thisJson = { "imgList": [ { "order": 1, "src": "../res/ct/1.jpg", "time": "0 阅读全文
posted @ 2021-11-23 10:00 蓝色精灵jah 阅读(32) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示