简体   繁体   English

Rails kaminari无限滚动:7获取加载页面的请求

[英]Rails kaminari infinite scroll : 7 get requests to load 1 page

I am new with kaminari (ruby) and I just implemented the kaminari infinite scroll. 我是kaminari(红宝石)的新手,我刚刚实现了kaminari无限滚动。 I followed the tutorial step by step and I noticed that the JQuery makes 7 get requests to load one page whitch is a lot. 我一步一步地遵循了教程,我注意到JQuery发出了7个get请求来加载一页页面,这一点很多。 I think it's a bug. 我认为这是一个错误。 How can we lower this to one call ? 我们如何将其降低到一个电话?

You will find here the JQuery code https://raw.githubusercontent.com/paulirish/infinite-scroll/master/jquery.infinitescroll.js 您将在此处找到JQuery代码https://raw.githubusercontent.com/paulirish/infinite-scroll/master/jquery.infinitescroll.js

Thanks ! 谢谢 !

I finally implemented this tutorial with kaminari (instead of will paginate) : http://www.sitepoint.com/infinite-scrolling-rails-basics/ . 我最终使用kaminari(而不是paginate)实现了本教程: http : //www.sitepoint.com/infinite-scrolling-rails-basics/ FYI, there are 2 or 3 adaptations to perform to make that tutorial work with kaminary. 仅供参考,要使该教程适用于kaminary,需要执行2或3种改编。 Ask me if you want to know more about that. 问我是否想进一步了解。 after that, it works just fine on smartphones and consumes very low ressources client-side. 之后,它在智能手机上就可以正常工作,并且客户端消耗的资源非常少。

V. V.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM