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 www.quora.com #
 
PREVIOUS NEXT
Tagged: #access #json #file #JS #file
ADD COMMENT
Topic
Name
8+8 =