Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

import json data in js file

<script type="module">
import data from "./data.json" assert { type: "json" };
console.log(data);
</script>

// also add this=> type:"module" in json file as object
Source by www.stefanjudis.com #
 
PREVIOUS NEXT
Tagged: #import #json #data #js #file
ADD COMMENT
Topic
Name
1+5 =