3 ms·
How does this work? I looked at the source and don't see anything specifically related to scrolling.
by cranberryturkey 5y ago
How does this work? I looked at the source and don't see anything specifically related to scrolling.
- easrng 5y agoIt's server side magic. The connection is kept open, and there's link to load more along with an img tag with loading="lazy" at the bottom of the page. When the image is requested (which happens once you've scrolled close to it because of loading="lazy"), the server sends more facts and a new style tag that hides the previous "load more" link on the existing connection. You can read the server-side source at https://glitch.com/edit/#!/noscript-infinite-catfacts https://glitch.com/edit/#!/noscript-infinite-catfacts
- cranberryturkey 5y ago