I have an JSON file (I cannot change), data.json
that looks like:
{
"Data": [
{
"AccountId": "1234",
"ClientId": "12345567",
"Amount": 140.68,
"BalanceYear": "2015",
"AccountName": "Master"
},
"Success": true,
"Errors": null
}
I am bringing it into my .js file as such:
<script type="text/javascript" src="./data.json"></script>
And I want to iterate through it with JSON.parse
.
My only issue is getting the data from the .json file to the JSON.parse
function.
var mydata = JSON.parse(???);
Would anyone know how I can do this?