TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

JQuery Condom, Namespaces for Plugins

4 点作者 kuroir将近 14 年前
jQuery Condom provides a namespace functionality which will allow you to create jQuery plugins on the fly; without touching the main jQuery.fn method. You have the same amount of control as if defining it from jQuery.fn.<p>This library is not meant to replace jQuery.fn, it's meant to work with it.<p>The jQuery official Plugin Authoring guide states: Under no circumstance should a single plugin ever claim more than one namespace in the jQuery.fn object. [source.]. And this library will help you follow that rule.<p>When you write a plugin (or any portion of code for that matter), you'll usually end up passing jQuery objects as attributes to methods; breaking the jQuery way (and sweet chains).

暂无评论

暂无评论