I am encountering an issue with the JSON file below:
{
"foo supé": 10
}
My attempt is to extract and log the value of the field "foo supé" into the console using the code snippet provided:
<!DOCTYPE html>
<html>
<script src= "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<body>
<div ng-app="myApp" ng-controller="myCtrl">
</div>
<script charset="utf-8">
var app =angular.module('myApp', []);
app.controller('myCtrl', function($scope, $http){
$http.get('./data.json').success(function(json) {
console.log(json["foo supé"]);
});
});
</script>
</body>
</html>
Upon checking the console, I receive "undefined" as the output when trying to read the value with accent marks. However, it works fine without the accents. How can I resolve this issue?