Why Plugins?

Contact Us or call 1-877-932-8228
Why Plugins?

Why Plugins?

Not every situation calls for the development of a plugin, certainly, but it makes lots of sense to use plugins when you are writing JavaScript code to perform any complex task. First, plugins are a way to work in "the jQuery way": you write some functionality and then you (or others, if using your plugin) apply that functionality to a DOM element or set of elements. A plugin named myPlugin might be called when the page initializes as such:


Second, plugins (good plugins) allow for chaining, so that you can apply the plugin in a chain just like any other jQuery methods:


Third, plugins are a great way to organize code: with an objected-oriented approach to plugin development - the approach we'll take here - you can combine stateful data, private methods, optional configuration parameters, and other features into one central hunk of code.