TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

JQuery Condom, Namespaces for Plugins

4 pointsby kuroiralmost 14 years ago
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).

no comments

no comments