I have a JSON file in folder App_Data
. Now I want to read this file and keep it in a JS variable. This is the code I wrote but it's not working.
$(document).ready(function () {
$.getJSON("~/App_Data/smartParkTotalJson.json", function(json) {
});
});
UPDATE
For now, I just want to check if its read. so I wrote this code:
<script>
$(document).ready(function () {
$.getJSON("/App_Data/smartParkTotalJson.json", function (json) {
alert("sff");
});
});
</script>
I want to get some alert