jQuery插件,值得创建吗? [英] JQuery plugin, worth to create?

查看:66
本文介绍了jQuery插件,值得创建吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,这不是我遇到问题的问题,而是寻求有关JQuery插件开发的建议.我们必须同意,有许多不同类别的JQuery插件,例如图像库,表单验证,效果等.

我正准备用方法创建一个基本的JQuery插件.我是JQuery插件开发的新手,但是我确实有必要的教程来简化一个,而且在学习之前确实做了一个.

问题是:

创建带有方法的JQuery插件还是仅创建一个开放源代码脚本插件(用户可以在其中自由修改并将其嵌入自己的网站中)值得吗?

换句话说,通过使用方法创建JQuery插件,使用不带可自由自定义的方法的开源JQuery或JavaScript插件来创建JQuery插件,我看不出太大的区别.例如,有一个TinyMCE,一个富文本编辑器,它是纯JavaScript的插件,并且不建议人们进行修改的方法.如果要修改以添加/删除功能,只需将其开源即可进行编码. TinyMCE只是建议您使用默认功能.

但是,带有方法的JQuery插件的唯一优点是,使那些对网络知识不多的人可以轻松地配置其插件,而像TinyMCE这样的开放源脚本插件,则需要自己编写代码才能改善.

您怎么看?

Ok, this is not a question where I am having issues, but seeking an advise from on JQuery plugin development. We have to agree, there are many JQuery plugins in different categories such as image gallery, form validations, effects and so on.

I was about to create a basic JQuery plugin with methods. I am new in JQuery plugin development, but I do have my required tutorials to cretae one and I did make one before when learning.

The question is:

Is it worth to create a JQuery plugin with methods, or simply create an open source script plugin, where a user can modify freely and embed it in their websites?

In other words, I do not see a huge difference, by creating a JQuery plugin with methods, with an open source JQuery or JavaScript plugin without methods where you can customize freely. For example, there is TinyMCE, a rich text editor, it is a plugin in pure JavaScript and does not propose methods for people to modify. If you want to modify to add/remove features, simply do it by coding as it is open source. TinyMCE just propose you a default functionality.

However, the only advantage a JQuery plugin with methods will have is to let people who have poor knowledge on web to configure their plugin easily while an open source script plugin like TinyMCE for instance, you need to code by yourself if you want to ameliorate.

What do you think?

推荐答案

jQuery可用的最佳功能是将对项目的调用链接在一起.因此,如果您想创建某种东西.值得与其他jQuery特定工具(例如隐藏,样式,单击等)进行堆叠,然后一定要这样做.在另一种情况下,这取决于您要创建的内容.
Best feature available with jQuery is chaining of calls to items. So If you want to create something that is. Worth to stack with other jQuery specific tools like hide, style, click etc. then by all means do it. In another case it depends of what you want to create.


这篇关于jQuery插件,值得创建吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆