Solved

Jquery widget vs plugin what is the difference?

Posted on 2012-04-13
4
337 Views
Last Modified: 2012-05-07
What is the difference?
Is one better than the other?
Is there a difference?
0
Comment
Question by:jackjohnson44
  • 2
4 Comments
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
a widget is ready to use
a plugin help you to develop a widget or anything you want.
0
 
LVL 2

Accepted Solution

by:
mdeweerd earned 500 total points
Comment Utility
A jQuery widget extends the common jQuery UI widget API, normally by using the jQuery Widget factory.
That way of working simplifies the task of extending jQuery for UI interface element/widget.

Some widgets are ready to use (if you take them from the jQuery UI library for instance), but you can also create your own.

A 'plugin' is not limited in its use (you can create more than widgets with it), and you would not be extending the widget base already provided by jQuery.

If using the jQuery Widget is possible, then that is a better solution because the implementation will be more efficient (not as much work to create it).
So you could say that in these cases, a widget is better.
However, you'll need jQuery UI which is an extra library.

Which solution is better, depends on the context.
0
 

Author Comment

by:jackjohnson44
Comment Utility
Thanks, so is it safe to say that a Widget is a type of plugin which requires jQuery UI?  If I am already using jQuery UI, I might as well use a widget because it does some plumbing for me.
0
 
LVL 2

Expert Comment

by:mdeweerd
Comment Utility
Hi

A Widget is a general term - it already existed in 1995 (and surely before that).

I agree that the jQuery Widget already does some plumbing for you.  However, it does require you to somewhat understand the extra level of abstraction and the way a widget works.  Once you've understood that, using the widget structure is a great timesaver.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now