I have JSON file in my application and I am tying to access the data in it using Java script.
NOTE: I am not looking for loading JSON file using Ajax call.
Json file Name: PhotoDatabase.json
var photosdatabase =
"photo_title": "Atardecer en Embalse",
HTML call of JSON file:
<script type="application/json" src="~/PhotosDatabase.json"></script>
Java Script access to json file:
pics = photosdatabase.photos;
The same works in local Java script files but not working in MVC.
In browser sources the JSON file is not loaded.
Should I add some permissions to make the JSON file load into browser?
What I have tried:
I tried to add this to my web config file
<mimeMap fileExtension=".json" mimeType="application/json"/>
This didn't work. More over it messed up all and nothing loaded like content files and script files and loaded just text.