Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

access json file from JS file

Using fetch function
Code to access employees.json using fetch function −

fetch("./employees.json")
.then(response => {
   return response.json();
})
.then(data => console.log(data));
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #access #json #file #JS #file
ADD COMMENT
Topic
Name
1+9 =