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

推荐订阅源

Latest news
Latest news
T
Troy Hunt's Blog
V
Vulnerabilities – Threatpost
L
LINUX DO - 热门话题
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
V
V2EX
博客园 - 司徒正美
B
Blog RSS Feed
AWS News Blog
AWS News Blog
MyScale Blog
MyScale Blog
Scott Helme
Scott Helme
Cisco Talos Blog
Cisco Talos Blog
Last Week in AI
Last Week in AI
NISL@THU
NISL@THU
博客园 - Franky
P
Proofpoint News Feed
博客园_首页
C
CERT Recently Published Vulnerability Notes
雷峰网
雷峰网
S
Schneier on Security
P
Proofpoint News Feed
Hugging Face - Blog
Hugging Face - Blog
G
GRAHAM CLULEY
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
WordPress大学
WordPress大学
The Hacker News
The Hacker News
T
Threatpost
阮一峰的网络日志
阮一峰的网络日志
A
Arctic Wolf
Microsoft Azure Blog
Microsoft Azure Blog
T
The Exploit Database - CXSecurity.com
Engineering at Meta
Engineering at Meta
罗磊的独立博客
T
The Blog of Author Tim Ferriss
D
Darknet – Hacking Tools, Hacker News & Cyber Security
I
Intezer
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
K
Kaspersky official blog
SecWiki News
SecWiki News
云风的 BLOG
云风的 BLOG
美团技术团队
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - 【当耐特】
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Security Latest
Security Latest
C
Cyber Attacks, Cyber Crime and Cyber Security
B
Blog
S
Security Affairs

博客园 - 锐洋智能

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 使用。