使用 PHP 缩小 jQuery

发布于 2024-09-08 09:09:42 字数 357 浏览 4 评论 0原文

将 jQuery 与其他 js 文件一起压缩的最佳方法是什么?我的目标是对我的所有 JS 文件发出一个请求。我还有大约 6 个其他 js 文件,我想将它们与 jQuery 和 jQuery UI 结合起来。当我将 jQuery 库和 UI 库保留在缩小文件之外时,就没有问题了。所以我有三个请求:

  1. jQuery 库
  2. jQuery UI
  3. 缩小剩余的 js 文件

我尝试将 1 和 2 与 3 结合起来,但 jQuery 总是说它是未定义的。我尝试使用 jQuery 的缩小版和非缩小版。

我正在使用 yahoo 的 php minify 程序。有什么建议吗?

谢谢, 布莱恩

What is the best way to minify jQuery with other js files. My goals is one request for all my JS files. I have about 6 other js files that I would like combine with jQuery and the jQuery UI. When I leave the jQuery library and UI library out of the minification file it is fine. So I have three requests:

  1. jQuery library
  2. jQuery UI
  3. minified remaining js files

I tried combining the 1&2 with 3 but jQuery always says it is undefined. I tried using both the minified and NON minified versions of jQuery.

I am using the php minify program from yahoo. Any suggestions?

Thanks,
Brian

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

小鸟爱天空丶 2024-09-15 09:09:42

确保以正确的顺序组合它们。 jQuery 必须是第一位的。

Make sure you combine them in the correct order. jQuery must be first.

メ斷腸人バ 2024-09-15 09:09:42

尝试使用 Reducisaurus,只要您在正确的顺序一切都应该正常。

PS: 确保缓存 Reducisaurus 缩小版,有时它太忙而无法提供文件。

Try using Reducisaurus, as long as you define the files in the right order everything should work fine.

PS: Make sure you cache the Reducisaurus minification, sometimes it is too busy to serve your files.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文