v.simple fetch

PHOTO EMBED

Thu Aug 04 2022 22:36:46 GMT+0000 (Coordinated Universal Time)

Saved by @gsinghg19 #javascript

fetch('fetching here.json or fetching url here')
  .then((response) => {
    if (!response.ok) {
      throw new Error(`HTTP error: ${response.status}`);
    }
    return response.json();
  })
  .then((json) => initialize(json))
  .catch((err) => console.error(`Fetch problem: ${err.message}`));
content_copyCOPY