您在应用程序的javascript中使用了哪些面向对象的设计模式,为什么?

Feel free to post code, even if there is no formal design pattern attached to it.

I have written plenty of javascript, but I have not applied much object orientated patterns to what I am doing, and I am sure i am missing a lot.

推荐答案

The following are three popular JavaScript patterns. These happen to be easily implementable because of closures:

You may also want to check out:

The following is a Google I/O talk from 2008 presented by Diaz, where he discusses some topics from his book:

Jquery相关问答推荐

在函数 jQuery 中更改语言

Jquery $(this) 子 Select 器

如何从 jQuery 转到 React.js?

在 jQuery 中构建 html 元素的最清晰方法

JavaScript 中的循环计时器

使用 jQuery 的并行异步 Ajax 请求

JQuery 仅在 Rails 4 应用程序中的页面刷新时加载

如何使用 JQuery 发布 JSON 数据?

调用 e.preventDefault() 后提交表单

删除索引后的所有项目

jquery 从特定表单获取所有输入

验证外部脚本是否已加载

在javascript中检测按键的最简单方法

如何使用 Twitter Bootstrap 自动关闭alert

通过单击按钮获取表格行的内容

jQuery .hasClass() 与 .is()

jquery,id内类的 Select 器

通过 javascript/jquery 删除/截断前导零

如何获取第一个元素而不是在 jQuery 中使用 [0]?

jQuery - 不可见时获取元素的宽度(显示:无)