Can someone concisely explain the differences between jQuery plugins and jQuery UI widgets? What are the conceptual differences? Why would I choose one over the other and what pros and cons are there for each. What are the differences in the intention and concept for each?
I've written both, but I'm not clear on the nitty gritty differentiations. I want to make sure I'm choosing appropriately in each case.
Thanks!
A jQuery plugin is a method that we use to extend jQuery's prototype object. It is a piece of code written in a JavaScript file, which enables all jQuery objects to inherit any methods that you add.
jQuery is the core library. jQueryUI is built on top of it. If you use jQueryUI, you must also include jQuery. jQuery Tabs preceded jQueryUI library.
If you want to use jQuery. UI you have to include jQuery.
The widget factory defines how to create and destroy widgets, get and set options, invoke methods, and listen to events triggered by the widget. By using the widget factory to build your stateful plugins, you are automatically conforming to a defined standard, making it easier for new users to start using your plugins.
Widgets are part of the jQuery UI library, where plugins aren't. Also, the Widgets have a visual component for the GUI, whereas plug-ins don't necessarily (although some do).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With