Solved

jQuery plugin vs jQuery core libary

Posted on 2012-03-31
11
697 Views
Last Modified: 2012-03-31
Greetings,

Consider the following instructions:

No other external JS libraries may be used besides the jQuery core.

Would any one interpret that to mean that jQuery plugins cannot be used?  My thought was since a plugin is not a JS library, the use of plugins would be permissible.  

Am I missing something?
0
Comment
Question by:max7
  • 4
  • 4
  • 3
11 Comments
 
LVL 7

Expert Comment

by:designatedinitializer
ID: 37791891
No. "jQuery core" excludes anything else, even plugins. Plugins are NOT jQuery core.
0
 
LVL 3

Expert Comment

by:animecyc
ID: 37791901
The above comment is correct. A plugin only extends the core functionality of jQuery, it is commonly a separate file included after jQuery.
0
 
LVL 1

Author Comment

by:max7
ID: 37791925
ok ... but I guess the wording is confusing to me specifically:

No other external JS libraries  ...


Am I correct in that a jQuery plugin is NOT a library?
0
 
LVL 3

Expert Comment

by:animecyc
ID: 37791939
From what I can tell you are correct in your understanding, a jQuery plugin only extends the jQuery Core library.

TL;DR

A jQuery plugin is not a library.
0
 
LVL 7

Expert Comment

by:designatedinitializer
ID: 37791941
no, I think you are not.
'Library' or 'plugin' in this case is just different wording for "a bunch of prepackaged JS functions that provide you functionality you sould be coding yourself in the first place".
A plugin is always a library. It's just a library which abides to a specific API, in this case the jQuery plugin API.
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 3

Assisted Solution

by:animecyc
animecyc earned 250 total points
ID: 37791952
While the above comment is correct from a technical standpoint, looking at the big picture: A jQuery plugin in this case adds to or extends a pre-existing library. The library in question being jQuery.

From a broader standpoint designatedinitializer is in fact correct as one would assume a library is just a collection functions that make doing something easier.
0
 
LVL 7

Accepted Solution

by:
designatedinitializer earned 250 total points
ID: 37791960
from the standpoint of the question asked, I am also right.
Notice the contradiction:

@animecyc
"...a jQuery plugin only extends the jQuery Core library"

@max7
"No other external JS libraries may be used besides the jQuery core."

This is a problem of logic/semantics/philosophy...
If you want the truth, there it is. If you want to hear what your heart desires...

If all else fails, you can always say "The dog ate my JavaScript"
;)
0
 
LVL 3

Expert Comment

by:animecyc
ID: 37791974
As I stated: "... the above comment is correct from a technical standpoint". Without context we can only be relative in our understanding.

Although we can truly be sure one thing: The dog did eat my JavaScript.
0
 
LVL 1

Author Comment

by:max7
ID: 37791993
'Library' or 'plugin' in this case is just different wording for "a bunch of prepackaged JS functions that provide you functionality you sould be coding yourself in the first place".

So I guess you never use plugins?  My hat is off to you ;)

But I think there is a tremendous difference between a single plugin and an entire JS library.  Comparing the two as if there is essentially no difference would be like comparing a single book to entire library of books.  Both contain words, ideas, thoughts, etc but you would never refer to a single book as a "library" for obvious reasons.


from the standpoint of the question asked, I am also right.
Notice the contradiction:
...........

Right, I thought this as well  ... setting aside the issue of "is a plugin a JS Library?" the fact that the original statement in question says that only the jQuery core can be used precludes the use of plugins.

If all else fails, you can always say "The dog ate my JavaScript"
;)

Yes, sometimes I wish I could say this! :)
0
 
LVL 1

Author Closing Comment

by:max7
ID: 37791998
Thanks for hashing this out with me guys, very interesting discussion!
0
 
LVL 7

Expert Comment

by:designatedinitializer
ID: 37792049
I beg to differ on this:
Comparing the two as if there is essentially no difference would be like comparing a single book to entire library of books.

There is a fundamental difference between a library and a book, as there is a difference between a function and a method in a class. A book is a container for a story, etc., while a library is a container for books. You can have a library with just one book, and it still is a library.
The problem here is a matter of categorization. That's why I mentioned philosophy.
But this is also a frame of mind absolutely indispensable for a programmer.
It's when we overlook these subtleties that we mess up.

PS: I don't code everything I need, I was saying that because this looks like it's your homework assignment we're talking about, so... if the prof tells you to not use other libraries then you should code it yourself.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Close "X" button on window popup in Firefox 7 36
Form with Modals 16 42
Error in script 11 45
How to make this slider behave as it should with javascript 4 8
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
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…

910 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

18 Experts available now in Live!

Get 1:1 Help Now