adong搬砖

导航

随笔分类 -  前端 / js

cookie基本用法
摘要:后端设置响应头set-cookie set-cookie mykey=12; Expires=截至MGT时间; Max-age=180; Domain=域名; Path=/; SameSite=Lax; Secure; http-only name=value:必须项,键值对(不能有分号、逗号、空格 阅读全文

posted @ 2026-06-25 11:33 adong搬砖 阅读(3) 评论(0) 推荐(0)

ajax 基本语法
摘要:// ajax 基本语法 const xhr = new XMLHttpRequest() xhr.open() xhr.send() xhr.onload = function () { console.log(xhr.responseText) } 阅读全文

posted @ 2026-06-21 11:29 adong搬砖 阅读(3) 评论(0) 推荐(0)

dom操作
摘要:节点类型 元素类型 元素节点 属性节点 文本节点 注释节点 nodeName 大写标签名 属性名 #test #comment nodeType 1 2 3 8 nodeValue null 属性值 文本内容 注释内容 获取节点 <body> <ul> <!-- 注释 --> <li>1</li> 阅读全文

posted @ 2026-02-04 20:39 adong搬砖 阅读(11) 评论(0) 推荐(0)

表情大全
摘要:🐊 😭 😂 😄 😍 😛 🤔 🤐 😴 🤧 🤠 😎 😞 😠 💩 😸 🙈 ❤ 💋 😄 😀 😃 😄 😁 😆 😅 🤣 😂 🙂 🙃 🫠 阅读全文

posted @ 2024-03-03 16:51 adong搬砖 阅读(77) 评论(0) 推荐(0)

随机数(整数)
摘要:function getintrandom(a,b){ return Math.floor(Math.random()*(Math.abs(b-a)+1)+Math.min(a,b))//包头包尾 } 阅读全文

posted @ 2023-11-26 01:40 adong搬砖 阅读(20) 评论(0) 推荐(0)

九九乘法表
摘要:document.write('<table style="border-spacing:12px">') for (var j = 1; j <= 9; j++) { document.write('<tr align="left">') for (var i = 1; i <= j; i++) 阅读全文

posted @ 2023-11-26 01:29 adong搬砖 阅读(25) 评论(0) 推荐(0)

防抖节流
摘要://****************节流********************** //节流代码 function throttle(f) { let timer return function () { if (timer) return timer = setTimeout(() => { f 阅读全文

posted @ 2023-11-26 01:22 adong搬砖 阅读(26) 评论(0) 推荐(0)