我有这个奇怪的错误,我不知道如何解决。我不断收到错误:语法错误:标记','是表达式第 6 列的意外标记 [Cough, splutter, slobber 你是谁?你想要什么?] 已从 JSON 文件加载。它已经工作了几个星期,但现在没有了
这是调用字符串的代码行
<div id="story-text" ng-bind-html-unsafe="{{page.text}}" ></div>
这是工厂加载似乎正确加载的数据
.factory('Stories', ['$http', function($http) {
var factory = {};
var stories = null;
stories = $http.get('./json/stories.json')
.success(function(data) {
stories = data;
})
.error(function(data, status) {
alert(data);
alert(status);
});
factory.getStories = function() {
return stories;
};
factory.getStory = function(id) {
return stories[id];
};
factory.getPage = function(id, page) {
return stories[id].pages[page];
};
return factory;
}])
最后,这一行将 JSON 文件中的数据加载到要在部分执行的范围内
$scope.page = Stories.getPage($scope.param.id - 1, $scope.param.pageNo - 1);
据我所知,没有什么明显的错误正在加载的 JSON 是
"PageNo": 1,
"text": "Cough, splutter, slobber </br> Who are you? What do you want?",
"image": "img/story-1/jpg/1.jpg",
"sound_background": "sound/story-1-sound/Story1A.aif",
"sound_voiceover": "sound/story-1-voiceover/Story1-01.mp3"
谁能看到我看不到的东西