DEV Community

Cover image for Vanilla JavaScript Infinite Scroll using WordPress REST API
Cadu de Castro Alves
Cadu de Castro Alves

Posted on

7 2

Vanilla JavaScript Infinite Scroll using WordPress REST API

This pen is a real example of how to build an Infinite Scroll in Vanilla JavaScript. I've used Fetch API, Intersection Observer API, and WordPress REST API to fetch posts. Feel free to fork, use, and modify this code.

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more