惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Engineering at Meta
Engineering at Meta
D
DataBreaches.Net
云风的 BLOG
云风的 BLOG
B
Blog
T
The Blog of Author Tim Ferriss
MyScale Blog
MyScale Blog
A
About on SuperTechFans
H
Heimdal Security Blog
AI
AI
F
Full Disclosure
The Last Watchdog
The Last Watchdog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
量子位
I
InfoQ
Martin Fowler
Martin Fowler
MongoDB | Blog
MongoDB | Blog
WordPress大学
WordPress大学
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
N
News and Events Feed by Topic
腾讯CDC
L
LINUX DO - 最新话题
Attack and Defense Labs
Attack and Defense Labs
Hacker News: Ask HN
Hacker News: Ask HN
Google Online Security Blog
Google Online Security Blog
博客园_首页
Forbes - Security
Forbes - Security
The Register - Security
The Register - Security
博客园 - 三生石上(FineUI控件)
PCI Perspectives
PCI Perspectives
V
Vulnerabilities – Threatpost
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Recent Commits to openclaw:main
Recent Commits to openclaw:main
L
LangChain Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
NISL@THU
NISL@THU
博客园 - Franky
Microsoft Security Blog
Microsoft Security Blog
J
Java Code Geeks
Simon Willison's Weblog
Simon Willison's Weblog
O
OpenAI News
H
Hacker News: Front Page
Project Zero
Project Zero
P
Privacy International News Feed
Cyberwarzone
Cyberwarzone
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
大猫的无限游戏
大猫的无限游戏
Application and Cybersecurity Blog
Application and Cybersecurity Blog

博客园 - 锐洋智能

windows 下 降级迁移 Redis 8.8.0(源) → Redis 8.6.3(目标) Eclipse IDE for Enterprise Find/Replace 窗口可以"停驻" 安装 SDelete 方式 SDelete 的核心作用,不是 “删文件”,而是 “把你已经删掉的文件,彻底从磁盘上抹干净”,同时帮你把虚拟机里的 “空闲空间” 变成连续的、可被回收的状态。 windows 10 启动就运行了一个批处理文件 在什么地方修改?启动项中? 让 Spring Framework7.0.7 支持 velocity Java 9+ 开启了模块化安全限制,不允许 Ignite 直接访问底层内存地址,导致 Ignite 启动失败 Spring 5.x + 老项目的 JWT 拦截器 + 自动续期 接口鉴权:Session/Cookie 与 JWT 的核心区别 下是针对 RedisSessionManager 的 Tomcat context.xml 配置示例,覆盖基础单机 Redis、带密码 / 指定库、Redis 哨兵集群、自定义序列化 / 持久化策略 等常见场景 Redis-8.6.3-Windows-x64-cygwin 与 Redis-8.6.3-Windows-x64-msys2 有什么不一样? commons-fileupload2 M4 升级 M5 报错解决方案 阿里云的网络安全策略 ip 地址详细说明 Paralithic、 QLExpress、AviatorScript、exp4j 性能对比一下 java 序列化影响(重要!) paralithic 与 Aviator 表达式那一个更快 券商接受委托的完整时间线 xheditor插件无限递归错误解决方法 jedis-7.1.0.jar 升级至 jedis-7.2.0.jar 就提示:The type JedisPoolConfig is deprecated The type JedisPooled is deprecated Spring 从 5.x 到 6.x 和 7.x 区别 js 原生 剪切板 复制功能 安装 Microsoft Visual C++ 运行时 Java与Python进程通信优化方案 Autocomplete | jQuery UI 同一面页定义不同的 .ui-autocomplete Quartz的misfire处理策略设置不当导致Job在应用启动时立即执行。 mysql-connector-j-9.5.0.jar BUG 推荐几款好用的CSS在线压缩工具 CSS 变量 定义及引用 TLS virtual host [_default_], certificate type [RSA] configured from keystore [d:/reyo/jks/localhost.jks] using alias [tomcat] with trust store [null] okhttp5.x 需要在 请求级别 控制是否使用重试拦截器,而不是在客户端级别 Apache Commons FileUpload 1.x 与 2.x 的主要区别
jQuery 4.0 移除了许多已废弃的方法和特性
锐洋智能 · 2026-01-26 · via 博客园 - 锐洋智能

jQuery 4.0 移除了许多已废弃的方法和特性。以下是主要的移除内容:

1. 已废弃的方法移除

类型检测方法

// 全部移除
$.type()      // 用 typeof、Array.isArray() 等替代
$.isArray()   // 用 Array.isArray() 替代
$.isFunction() // 用 typeof obj === 'function' 替代
$.isNumeric() // 用 !isNaN(parseFloat(obj)) && isFinite(obj) 替代
$.isEmptyObject() // 用 Object.keys(obj).length === 0 替代
$.isPlainObject() // 需要手动实现或使用其他库
$.isWindow()   // 用 obj && obj.window === obj 替代

字符串处理方法

$.trim()      // 用 String.prototype.trim() 替代
$.param()     // 用 URLSearchParams 或手动实现

DOM 相关方法

$.nodeName()  // 用 element.nodeName 或 element.tagName 替代
$.holdReady() // 完全移除
$.cssHooks    // 部分移除

2. 废弃的 Ajax 方法

// 这些方法已被移除
$.ajax() 中的 async: false 支持  // 同步请求被移除
$.ajax() 中的 `success`、`error`、`complete` 回调参数
$.ajax() 的 `crossDomain`、`isLocal`、`jsonp` 选项简化
$.event 中的 ajax 事件别名(ajaxSuccess/ajaxError 等)

3. 事件相关移除

// 已移除
.load() 作为事件快捷方式            // 只能用作 AJAX 方法
.unload() 事件                    // 用 beforeunload 替代
.hover() 方法                     // 用 .on('mouseenter mouseleave') 替代

// 事件方法移除
$.fn.bind() 和 $.fn.unbind()      // 用 .on() 和 .off() 替代
$.fn.delegate() 和 $.fn.undelegate() // 用 .on() 和 .off() 替代
$.fn.toggle()                    // 移除事件切换功能
$.fn.size()                      // 用 .length 替代

4. 动画相关移除

// 已移除
$.fn.toggle() 的动画功能          // 只保留显示/隐藏功能
$.fx.interval                   // 移除配置
.promise() 的动画特定方法

5. 数据缓存相关

// $.data() 和 $.removeData() 的行为变化
// 不再自动将字符串转换为 JSON
$.data(elem, "key", "true")     // 以前会转为 boolean,现在保持字符串

6. 其他移除

// 已移除
$.context                      // 早已废弃
$.support                      // 移除,用特性检测替代
$.selector                     // 早已废弃
$.attrFn                       // 早已废弃

// 移除了对老旧浏览器的支持
IE10 及更早版本的支持
旧版 WebKit 的支持

7. 行为变更

// 默认行为变化
$(htmlString)                  // 不再自动执行脚本
$(window).load()               // 不再支持
$(document).ready() 简写 $(fn) // 仍然支持,但内部实现优化

8. 迁移建议

创建兼容性补丁

// 在升级前添加兼容层
if (!$.type) {
    $.type = function(obj) {
        if (obj === null) return 'null';
        if (obj === undefined) return 'undefined';
        return Object.prototype.toString.call(obj).slice(8, -1).toLowerCase();
    };
}

使用替代方案

// 推荐的原生替代方案
const utils = {
    isFunction: obj => typeof obj === 'function',
    isArray: Array.isArray,
    isNumeric: value => !isNaN(parseFloat(value)) && isFinite(value),
    isEmptyObject: obj => Object.keys(obj).length === 0,
    trim: str => String(str || '').trim()
};

9. 检查清单

升级时检查以下常见问题:

  1. $.trim().trim()

  2. $.isFunction()typeof === 'function'

  3. $.isArray()Array.isArray()

  4. $.type()typeofObject.prototype.toString.call()

  5. $.nodeName().nodeName.tagName

  6. .bind()/.unbind().on()/.off()

  7. .delegate()/.undelegate().on()/.off()

建议使用 jQuery Migrate 插件帮助迁移,它会警告这些已移除的 API 使用。