是否有更好的(轻量级)解决方案可以在没有 jquery ui 的情况下使用 php 和 codeigniter 自动完成?
我正在为我的网站寻找一个轻量级且跨浏览器兼容的解决方案。这是我已成功实施的解决方案:
代码: 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是我使用的自动完成脚本: 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.
您可以在 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.