I have a problem with using data of a json file in my html document.
At the top you can see the errors that i get.
I have this file created as a json file New.json :
[
{ "firstname":"Thomas", "lastname":"Anderson" },
{ "firstname":"Agent", "lastname":"Smith" },
{ "firstname":"Agent", "lastname":"Brown" }
]
I tried this code to get the data from my json file
<script type="application/javascript">
$(document).ready(function() {
$("div").click(function () {
$.ajax({
type: 'GET',
url: './New.json',
dataType: 'json',
success: function(data){
window.alert(data);
},
});
});
});
</script>
Thanks for your help :)