Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why have the "jquery." prefix on plugin filenames?

I'm curious as to the reasoning behind the standard procedure of prefixing jQuery plugin filenames with "jquery.". Several tutorials state something like:

The use of the "jquery." prefix eliminates any possible name collisions with files intended for use with other libraries.

I believe I have even seen a couple of plugins that actually require themselves not be renamed.

Are there any more specific reasons for this prefix, or is it simple the convention?

like image 444
Mike Boers Avatar asked Sep 21 '10 12:09

Mike Boers


1 Answers

It's just a convention, for example:

jquery.lightbox.js
prototype.lightbox.js

If you just had this and were using both, well, you see where confusion sets in:

lightbox.js

Also, you might be using just vanilla JavaScript function files, and not want those to have a prefix, e.g. editor.js, denoting it has no reliance on jQuery at all...it's all around organization and maintainability.

like image 86
Nick Craver Avatar answered Dec 10 '22 11:12

Nick Craver