开发者

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

I'm curious as to the reasoning behind the 开发者_如何学JAVAstandard 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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜