是否有更好的(轻量级)解决方案可以在没有 jquery ui 的情况下使用 php 和 codeigniter 自动完成?

发布于 2025-01-03 22:56:06 字数 529 浏览 0 评论 0原文

我正在为我的网站寻找一个轻量级且跨浏览器兼容的解决方案。这是我已成功实施的解决方案:

代码: http://www.jamipietila.fi/codeigniter-and-autocomplete-with- jquery/ 工作示例: http://demosivut.net/demo/ci_jquery_autocomplete/index.php/autocomplete

但是使用 jquery.ui js 文件需要 200 kb,css 文件需要 33 kb。

我计划在每个页面中实现该自动完成框,似乎仅一个自动完成框就花费很多。

有没有更小的解决方案?

I was searching a lightweight and crossbrowser compatible solution for my web site. Here is the solution i have successfully implemented:

Codes:
http://www.jamipietila.fi/codeigniter-and-autocomplete-with-jquery/
Working Example:
http://demosivut.net/demo/ci_jquery_autocomplete/index.php/autocomplete

But using jquery.ui costs 200 kb for js file and another 33 kb for css file.

I am planning to implement that autocomplete box into every pages and it seems that costs a lot for just a autocomplete box.

Is there a smaller solution for this ?

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

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

发布评论

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

评论(2

自控 2025-01-10 22:56:06

这是我使用的自动完成脚本: http://www.devbridge.com/projects/autocomplete/ jquery/

当缩小时,它的重量为 7kb,但是它显然也依赖于 jQuery,这增加了占用空间。

但值得注意的是,如果您使用来自 CDN 的 jQuery UI,它很可能已经缓存在访问者浏览器中,因此连续加载时间将大大减少。

This is the autocomplete script I use: http://www.devbridge.com/projects/autocomplete/jquery/

It weighs in at 7kb when minified, however it obviously relies on jQuery too which adds to the footprint.

It's worth noting though that if you are using jQuery UI from a CDN, the chances are it's already cached in a visitors browser, therefore the successive load times will be vastly reduced.

今天小雨转甜 2025-01-10 22:56:06

您可以在 jquery ui 主页上自定义您的 jquery ui 库。因此,您可以取消选择不需要的每个组件。 http://jqueryui.com/download
否则,您可以尝试搜索 jQuery 自动完成插件,也许它们的大小较小。

You can customize your jquery ui libary on the jquery ui homepage. So you could deselect every component you don't need. http://jqueryui.com/download
Otherwise you could try to search for jQuery autocomplete plugins, maybe those are smaller in their sizes.

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