太多的jquery插件? [英] Too many jquery plugins?

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

问题描述

我正在开发一个网站,但我意识到,除了我的主要javascript文件的链接,以及jquery文件的链接之外,它开始看起来像我将要链接到三个或更多插件也。
我只是想知道这是不是很好的做法?我正在构建的网站是一个网络应用程序,所以我需要很多功能,但我不想成为插件贪吃者。将所有javascript插件一起附加到一个文件中以便只需要下载一个文件,或者我会遇到问题是否被认为是好的?

I'm developing a website, but I realized that, in addition to the link to my main javascript file, and the link to the jquery file, it's beginning to look like I'm going to have links to three or more plugins also. I'm just wondering if this is good practice? The site I'm building is a web app, so I need a lot of functionality, but I don't want to be a plugin glutton. Is it considered good to append all the javascript plugins together into one file so as to only have to download one file, or will I run into problems?

推荐答案

如果插件会为您的网站增加价值,我看不出这将是一个什么问题。通常,插件包含足够的代码来执行它们的目的。与使用具有大量未使用功能的单个库相比,这使得它们的使用相当不错。

If the plugins will be adding value to your site, I cannot see how that will be a problem. In general, plugins contain just enough code to do what they were meant to do. This makes their use quite a good practice when compared to using one monolithic library with plenty of unused functionality.

至于将JavaScript文件连接在一起,这可以帮助前端加载性能,所以我建议。

As for concatenating the JavaScript files together, that can help in terms of front-end loading performance, so I would recommend that.

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

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