MCPcopy Create free account
hub / github.com/codemistic/Web-Development / fetchData

Function fetchData

BirthDay-Wishing/script/main.js:280–296  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

278
279// Import the data to customize and insert them into page
280const fetchData = () => {
281 fetch("customize.json")
282 .then(data => data.json())
283 .then(data => {
284 Object.keys(data).map(customData => {
285 if (data[customData] !== "") {
286 if (customData === "imagePath") {
287 document
288 .getElementById(customData)
289 .setAttribute("src", data[customData]);
290 } else {
291 document.getElementById(customData).innerText = data[customData];
292 }
293 }
294 });
295 });
296};
297
298// Run fetch and animation in sequence
299const resolveFetch = () => {

Callers 1

resolveFetchFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected