简体   繁体   English

静态页面无限滚动它是如何工作的?

[英]Infinite scroll with static page how does it work?

中等https://medium.freecodecamp.org/上的这个页面使用无限滚动,但是在查看源代码时,html 在那里,所以它不使用 ajax 还是我弄错了?

Open the network panel in your inspector and watch the requests roll in as you scroll down.在检查器中打开网络面板,并在向下滚动时观察请求滚滚而来。 It's just getting jpg images so it's likely that the html is already there and the scroll action causes an ansync request for the image and javascript plugs it into the appropriate divs.它只是获取 jpg 图像,因此很可能 html 已经存在并且滚动操作会导致对图像的异步请求,并且 javascript 将其插入到适当的 div 中。

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

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