Settings

Theme

JQuery Condom, Namespaces for Plugins

github.com

4 points by kuroir 15 years ago · 1 comment · 1 min read

Reader

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.

This library is not meant to replace jQuery.fn, it's meant to work with it.

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.

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 yet.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection