I have a JSON file containing data that I want to read in Javascript instead of hard-coding them in code (more than 3000 lines).
I tried referencing JSON in HTML and using it but returned an empty array
In HTML:
<script type="file" src="data.json"></script>
In javascript:
console.log(JSON.parse(data))
I get back an empty array rather than the data.