Solved

Jquery widget vs plugin what is the difference?

Posted on 2012-04-13
4
383 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 82

Expert Comment

by:leakim971
ID: 37843085
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
ID: 37845039
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
ID: 37851165
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
ID: 37937730
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

Raise the IQ of Your IT Alerts

From IT major incidents to manufacturing line slowdowns, every business process generates insights that need to reach the people required to take action. You need a platform that integrates with your business tools to create fully enabled DevOps toolchains.

You need xMatters.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn how to dynamically set the form action using jQuery.
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)

691 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