• jQuery
  • jQuery UI
  • jQuery Mobile
  • Sizzle
  • QUnit
  • 插件
  • 贡献
    • CLA
    • 风格指南
    • 错误分类
    • 代码
    • 文档
    • 网站
  • 事件
  • 支持
    • 学习中心
    • 聊天
    • Stack Overflow
    • 报告 Bug
  • OpenJS 基金会
    • 加入
    • 成员
    • jQuery 团队
    • 治理
    • 行为准则
    • 项目

jQuery 学习中心

  • 首页
  • 关于
  • 贡献
  • 风格指南

代码组织

理解基本机制是一回事,但构建应用程序的精髓在于理解如何组织代码,使其可导航且良好封装,而不是一堆全局函数。

  • 代码组织概念
  • 警惕匿名函数
  • 保持 DRY(不要重复你自己)
  • 特性与浏览器检测
  • Deferreds
    • jQuery Deferreds
    • Deferred 示例
不要将 jQuery 视为黑盒
代码组织概念

最后更新时间

  • 2023年8月4日

建议、问题、反馈?

在 GitHub 上打开一个 Issue 或提交一个 Pull Request

章节

  • 关于 jQuery
  • 使用 jQuery 核心
    • 常见问题
  • 事件
  • 效果
  • Ajax
  • 插件
  • 性能
  • 代码组织
    • Deferreds
  • jQuery UI
    • Widget Factory
    • 使用 jQuery UI
  • jQuery Mobile

书籍

  • Learning jQuery 4th Edition by Karl Swedberg and Jonathan Chaffer Learning jQuery 第四版 Karl Swedberg 和 Jonathan Chaffer
  • jQuery in Action by Bear Bibeault, Yehuda Katz, and Aurelio De Rosa jQuery 实战 Bear Bibeault, Yehuda Katz 和 Aurelio De Rosa
  • jQuery Succinctly by Cody Lindley jQuery 简明教程 Cody Lindley
  • 学习中心
  • 聊天
  • Twitter
  • GitHub

Copyright 2026 OpenJS Foundation and jQuery contributors. All rights reserved. See jQuery License for more information. The OpenJS Foundation has registered trademarks and uses trademarks. For a list of trademarks of the OpenJS Foundation, please see our Trademark Policy and Trademark List. Trademarks and logos not indicated on the list of OpenJS Foundation trademarks are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them. OpenJS Foundation Terms of Use, Privacy, Code of Conduct, and Cookie Policies also apply.

网页托管由 Digital Ocean 提供 | CDN 由 Fastly 提供 | 由 WordPress 驱动