Skip to main content
100%

Loading data with fetch

✓ Published1🌍 Public
RRuanzhenglin
Last edited Apr 10, 2021
Created on Apr 10, 2021
Forked from HTML Starter

This example demonstrates how to load external data into a web page using the built-in Fetch API. It defines an asynchronous function, `fetchText`, that retrieves a CSV file containing named CSS colors from a GitHub Gist URL. The fetched text is then logged to the browser console. The code uses vanilla JavaScript within an HTML file, showcasing the `fetch` and `response.text()` methods without any additional libraries or frameworks.

AI-generated description

A bare minimum HTML page demonstrating use of CSS and JavaScript.

See also React Starter.

MIT Licensed

Similar vizzes